result->reccommendations as $r) { echo ""; echo sprintf(">\n" , $r->dist); echo sprintf("\n" , $r->type); echo sprintf("\n" , $r->cost); echo sprintf("\n" , $r->parking_chance); echo sprintf("\n" , $r->chance_weekday); echo sprintf("\n" , $r->chance_sat); echo sprintf("\n" , $r->chance_sun); $l = ""; $l .= "dist : " . $r->reccommended_pt_route->distance . "\n"; $l .= "duration : " . $r->reccommended_pt_route->duration . "\n"; $l .= "src : " . $r->reccommended_pt_route->src . "\n"; $l .= "url : " . $r->reccommended_pt_route->url . "\n"; $pts = ""; foreach ($r->reccommended_pt_route->legs as $L) { $l .= "
Leg : " . $L->mode . "from : " . $L->from->name . " to ". $L->to->name." ".$L->transitinfo->agency . " " .$L->transitinfo->line . " " . $L->transitinfo->polyline."
"; $p = json_decode($L->transitinfo->polyline); // $l .= "\n ". $p->points; $cnt++; $sm = "http://maps.googleapis.com/maps/api/staticmap?center=52.3681107,4.8562698&zoom=14&size=600x300&maptype=roadmap&path=weight:5|color:red|enc:".$p->points."&sensor=false&key=AIzaSyCfN3FpO9GEuiIc7wn4j-j3TGXkbSaDxb8"; $sm = "http://maps.googleapis.com/maps/api/staticmap?center=".$p->from->lat.",".$p->from->lon."&zoom=14&size=600x300&maptype=roadmap&path=weight:5|color:red|enc:".$p->points."&sensor=false&key=AIzaSyCfN3FpO9GEuiIc7wn4j-j3TGXkbSaDxb8"; $l .= sprintf("",$sm); } echo sprintf("",$l); // echo sprintf("",print_r($r->reccommended_pt_route,true)); echo "
Distance : %s
Type : %s
Cost : %s
Chance : %s
Chance day : %s
Chance sat : %s
Chance sun : %s
%s
%s



"; } ?>