Array_push giving unexpected (by me) result.
Posted: Wed Mar 18, 2015 9:12 pm
I'm trying to add contents of $db to array $rows. $db contains "bridge".
The result of this is two additions; One: :bridge", two "45" (the new length of the array).
I don't want "45" added to the array. Documentation suggests only " bridge" should have been added.
How can I fix this?
Appreciate help;
R
[43] => Array
(
[id] => 177
[playdate] => 2015-03-02
[player] => Rupp, Kathy
[score] => 2750
)
[44] => bridge
[45] => 45
The result of this is two additions; One: :bridge", two "45" (the new length of the array).
I don't want "45" added to the array. Documentation suggests only " bridge" should have been added.
How can I fix this?
Appreciate help;
R
Code: Select all
[b]$rows[]=array_push($rows, $db);[/b](
[id] => 177
[playdate] => 2015-03-02
[player] => Rupp, Kathy
[score] => 2750
)
[44] => bridge
[45] => 45