Answers for "foreach loop for object in php"

1

php loop through object

foreach ($obj as $key => $value) {
    echo "$key => $valuen";
    //echo "test greper";
}
Posted by: Guest on May-11-2021
2

php loop through object

$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;

foreach ($person as $key => $value) {
    echo $key.",".$value."n";
}
Posted by: Guest on June-11-2020

Browse Popular Code Answers by Language