Horje
array push object php Code Example
array push object php
$myArray = [];

array_push($myArray, (object)[
        'key1' => 'someValue',
        'key2' => 'someValue2',
        'key3' => 'someValue3',
]);

return $myArray;
add object in array php
$myArray = array("name" => "my name");
echo json_encode($myArray);
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.
Source: www.php.net




Php

Related
php refresh page Code Example php refresh page Code Example
reload page in php Code Example reload page in php Code Example
save html form data to text file using php Code Example save html form data to text file using php Code Example
php create file html Code Example php create file html Code Example
php exception message Code Example php exception message Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9