Answers for "array push in start php"

PHP
0

array prepend php

$arr = array('item2', 'item3', 'item4');
array_unshift($arr , 'item1');
print_r($arr);
Posted by: Guest on November-04-2021
0

php array push

If you're going to use array_push() to insert a "$key" => "$value" pair into an array, it can be done using the following:

    $data[$key] = $value;

It is not necessary to use array_push.
Posted by: Guest on December-13-2021

Browse Popular Code Answers by Language