Advertisement
Google Ad Slot: content-top
PHP Add Array Items
Add Array Item
You can add elements to the end of an array using the [] operator.
Associative Arrays
To add items to an associative array, use brackets [] and assigning a value to a new key.
Add Multiple Array Items
array_push() function appends one or more elements to the end of an array.
Add Multiple Items to Associative Arrays
You can use the += operator to add multiple key-value pairs to an associative array in PHP.