Add Array Item
To add items to an existing array, you can use the bracket []
syntax.
Example
Add one more item to the fruits
array:
$fruits = array("Apple", "Banana", "Cherry");
$fruits[] = "Orange";
To add items to an existing array, you can use the bracket []
syntax.
Add one more item to the fruits
array:
$fruits = array("Apple", "Banana", "Cherry");
$fruits[] = "Orange";