I am trying to use array_push but I am recieving error messages like:
Warning: array_push() expects parameter 1 to be array, string given in C:\Users\DMR\Google Drive\android\maquetas\show.php on line 50
in two linews where I am using array_push, I don't understand why, could you help me please? the code is the next:
...
$etiquetes = array("N.I.F.", "Direcció");
$tipus = array("varchar", "varchar");
$columnes = array("CIF_NIF", "DIRECCION");
$llongituds = array(30, 30);
...
$i=0;
foreach ($etiquetes as $etiqueta) {
$control = array_push($etiqueta, $columnes[$i], $tipus[$i], $llongituds[$i]); <==== IT GIVE ME ERROR (ATTACHED AT THE END)
$controls[$i % 2] = array_push($control); <==== IT GIVE ME ERROR (ATTACHED AT THE END)
$i++;
}
$etiqueta
is not an array thusis wrong. You might be looking for:
Also, from array_push() docs:
Which means $control will have an int value. So you second line
Is ofcourse invalid, I would suggest you look at the docs and try to figure out what are you planning to do.