array push php
$myArr = [1, 2, 3, 4];
array_push($myArr, 5, 8);
print_r($myArr); // [1, 2, 3, 4, 5, 8]
$myArr[] = -1;
print_r($myArr); // [1, 2, 3, 4, 5, 8, -1]<?php
$cesta = array("laranja", "morango");
array_push($cesta, "melancia", "batata");
print_r($cesta);
?>
<?php
$z = ['me','you', 'he'];
array_push($z, 'she', 'it');
print_r($z);
?><?php
$stack = array("orange", "banana");
array_push($stack, "apple", "raspberry");
?>
<?php
$array1 = array("color" => "red", 2, 4);
$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4);
$result = array_merge($array1, $array2);
/*
Array
(
[color] => green
[0] => 2
[1] => 4
[2] => a
[3] => b
[shape] => trapezoid
[4] => 4
)
*/
?><?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>
Also in PHP:
- date input n php
- Failed at the [email protected] production script. laravel
- carbon format date in laravel
- create new laravel project terminal
- db seeder artisan
- codeigniter delete record by id
- encryption and decryption in php example
- cmd disable wifi driver
- catch exception of method php
- days or month php api format
- find a character in a string php
- clear server cache laravel
- Adding string with number in php
- enfold remove debugging info for theme support
- check array key exists not in array php
- ci db query error
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 5287496 bytes) on laravel
- file_get_contents(http://cnh.local/dsc/uploads/1359e1e4c0a10294d9894146beb3e1e9.crt): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in file /opt/gitco/cnh_laravel/app/Repositories/CallRepository.php
- check image is available on server php
- data:image/png;base64 php
- error out of length in php
- change background color with user option
- date chenge format php
- adding spasifc date to date('Y-m-d H:i:s') php