array to object php

48

php convert array to object -

$object = (object) $array;

array to object php -

$object = json_decode(json_encode($array), FALSE);

convert array to object php -

$arrayResult = array_map(function($array){
    return (object)$array;
}, $yourOrinalArray);

php array to object -

$object = (object)$array;

Comments

Submit
0 Comments