PHP Arrays


#1

Here’s a sample of a query result:
stdClass Object ( [next_offset] => 1 [flights] => Array ( [0] => stdClass Object ( [ident] => UAL102 [aircrafttype] => B735 [filed_ete] => 03:05:00 [filed_time] => 1180442256 [filed_departuretime] => 1180456920 [filed_airspeed_kts] => 431 [filed_airspeed_mach] => [filed_altitude] => 350 [route] => PLAIN4 GLD J80 MCI J24 STL J8 IIU PSK SBV4 [actualdeparturetime] => 1180458000 [estimatedarrivaltime] => 1180469580 [actualarrivaltime] => 0 [diverted] => [origin] => KDEN [destination] => KRDU [originName] => Denver Int’l [originCity] => Denver, CO [destinationName] => Raleigh Durham Int’l [destinationCity] => Raleigh, NC ) ) )

I’m trying to use foreach in PHP to get into the subarray in the data…
foreach ($results as $name => $number) {
echo “Number for $name: $number
”;

foreach ($results as $key => $value) {
echo “$key: $value
”;
}
}

The only result I’m getting is the next offset value. I can’t get any of the data from the flight. Does anyone have a sample PHP file that solves this or gets at the actual flight information in a different way?

Many thank-yous in advance…
Marc