Code: Select all
$ob = new stdClass;
$ob->name = 'some-name';
$ob->email = 'email-address';
$ob->site = 'https://coursesweb.net/';
Code: Select all
$ob = new stdClass;
$ob->name = 'some-name';
$ob->email = 'email-address';
$ob->site = 'https://coursesweb.net/';
Code: Select all
$ob = new stdClass;
$ob->name = 'some-name';
$ob->email = 'email-address';
$ob->site = 'https://coursesweb.net/';
$arr = (array) $ob;
echo $arr['name'];
Code: Select all
$arr = [
'name'=> 'some-name',
'email'=> 'email-address',
'site'=> 'https://coursesweb.net/'
];
$ob = (object) $arr;
echo $ob->name;