|
Posted by Rik on 10/11/19 11:56
Flaming Corncob wrote:
> Is there any way to add to an already existing array?
Several, for instance:
1. $array[] = $value;
Will add a numerically indexed value on the end of the array
2. array_push($array, $foo, $bar,...);
Will add an arbitrary amount of variables to the end of the array
3. array_unshift($arraym$foo,$bar,....);
Same as array_push, only to the beginning
And many, many more possibilities, read up on it:
http://www.php.net/manual/en/ref.array.php
http://www.php.net/manual/en/language.types.array.php
--
Grtz,
Rik Wasmus
Navigation:
[Reply to this message]
|