PHP Array Push Key Value Example
May 28, 2021 . Admin

array_push(array, value1, value2, ...);Example 1:
The array_push() function inserts one or more elements to the end of an array.
<?php $a = array("laravel","php"); array_push($a,"css","bootstrap"); print_r($a); ?>Output:
Array ( [0] => laravel [1] => php [2] => css [3] => bootstrap )Example 2:
<?php $a=array("a"=>"cs","b"=>"cf"); array_push($a,"coa","html"); print_r($a); ?>Output:
Array ( [a] => cs [b] => cf [0] => coa [1] => html )It will help you....