add object in array 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]$myArray = array("name" => "my name");
echo json_encode($myArray);
Also in PHP:
- ata date format in php
- Which of the following method of Exception class returns the code of exception when error occured?
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://D:/Program Files/Composer - PHP/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- debug native php
- CREATE SEEDERS FROM DATABASES
- capitalize all letters php
- display al errros php
- enable the cache mechanisms laravel
- Artisan namespace
- check all file in server php
- Class 'Intervention\Image\ImageServiceProvider' not found
- dateFormat php
- array exists in php
- redirect php file
- current date to timestamp php
- date weschools
- array_key_exists not finding numbers
- auto generated password in php
- check if word in string
- check array key exists php js
- all files in a folder to array php
- cron job for backup in laravel 5.4
- find key in arrray php
- check composer version php