php through object code example
Example 1: php loop through obect
PHP By Wandering Weevil on Mar 8 2020
$person = new StdClass();
$person->name = "Ngbokoli";
$person->age = 31;
$person->nationnality = "Congolese";
$person->profession = "Student";
foreach ($person as $key => $value) {
echo $key." ".$value."\n";
}
Example 2: php loop through object
// Try edit message
const data = {
message: 'Hello world',
}
$('#msg').html(data.message)
console.log(data)