php loop through a colomn in a object code example
Example 1: 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";
}
Example 2: php loop through object
$person = new StdClass();
$person->name = "Taylor";
$person->age = 31;
foreach ($person as $key => $value) {
echo $key.",".$value."\n";
}