i'm trying to print out the values of an object which look like this
for (....) {
$data->user[$x]
$data->membersid[$x]
$data->status[$x]
}
i tried
$x=0;
for ($x=0; $x<3; $x++) {
foreach ($data as $name => $value) {
echo $name.": ".$value[$x]."<br>";
}
}
and the output looked like:
user: adf
membersid: 4
status: 1
user: afdkjlk
membersid: 3
status: 1
user: lkj
membersid: 5
status: 1
this is correct, except i hardcoded the '3' in there for the for loop. i do not know how to get the number of array elements within the object. thanks for the help
-cary