Answers for "php item list add"

PHP
7

php add item to array

<?php
  $z = ['me','you', 'he'];
  array_push($z, 'she', 'it');
  print_r($z);
?>
Posted by: Guest on June-02-2020
2

php array append

<?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
print_r($stack);
?>
Posted by: Guest on October-01-2020
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