Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

convert array to stdclass object in php example

<?php
$empInfo = array(
'name'=>'John',
'address'=>'Houston',
'employment' => array(
    'id' => '1',
    'address' => 'Los Angeles'
    )
);
// or 
$obj = (obj)['name'=> 'Jone Doe'];
print_r(json_decode(json_encode($empInfo)));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #array #stdclass #object #php
ADD COMMENT
Topic
Name
5+8 =