mercredi 3 janvier 2018

Laravel 5.0 array_merge function not working

I am trying to merge two array but it's not working in laravel 5.0.

$a1=array('statuscode' => true);
$a2=array('id' => 1,
          'transaction_ref_no' => '1980988776',
          'amount' => 1000,
          'date_of_transaction' => '2017-12-18 00:00:00',
          'method' => 'IMPS',
          'img' => '9cc78f7bedea44d75309e04234915106Penguins.jpg'
        );

$data = array_merge($a1,$a2);
print_r($data);

I need output like this

Array
(
     [statuscode] => 1
     [id] => 1
     [transaction_ref_no] => 1980988776
     [amount] => 1000
     [date_of_transaction] => 2017-12-18 00:00:00
     [method] => IMPS
     [img] => 9cc78f7bedea44d75309e04234915106Penguins.jpg
)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2DTPjqY
via IFTTT

Aucun commentaire:

Enregistrer un commentaire