i want to add data to an associative array with the following structure
$miarray = array(
array('factor' => $textof[1], 'valor' => $i1),
array('factor' => $textof[2], 'valor' => $i2),
array('factor' => $textof[3], 'valor' => $i3),
);
how should i start adding the first data to a new empty array
array('factor' => $textof[1], 'valor' => $i1),
and how should the following be added?
i want to use this in combination with a mysql query where i go through data, do something with it and pass the results to the array
$miarray = [];
while($row_1 = mysql_fetch_array($result_1)) {
do some calc here
push data
}
thanks for helping