rluckhurst@xxxxxxxxxxxxx wrote:
$count=count($data->legs->leg); $k=0; while($k < $count) { $legrow["$data->legs->leg[$k]['legId']"]=$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket'];
Drop the quotes in the key... $legrow[$data->legs->leg[$k]['legId']]=$data->legs->leg[$k]['depApt'].$VM.$data->legs->leg[$k]['depTime'].$VM.$data->legs->leg[$k]['dstApt'].$VM.$data->legs->leg[$k]['arrTime'].$VM.$data->legs->leg[$k]['equip'].$VM.$data->legs->leg[$k]['fNo'].$VM.$data->legs->leg[$k]['cr'].$VM.$data->legs->leg[$k]['miles'].$VM.$data->legs->leg[$k]['elapsed'].$VM.$data->legs->leg[$k]['meals'].$VM.$data->legs->leg[$k]['smoker'].$VM.$data->legs->leg[$k]['stops'].$VM.$data->legs->leg[$k]['eticket'];
$k++; } My thinking is that the $data->legs->leg[$k]['legId'] is the legId and I might use that as a key. This however does not work.
It will work if they are all unique. If you have any duplicates they will overwrite previous assignments.
-Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php