urban Posted April 4, 2009 Share Posted April 4, 2009 HI Here is my page http://muddy-bikes.co.uk/maptest/test1.html which grabs the cords getvars.php <?php print_r($_POST["routePoints"]); ?> this outputs (56.728621973140726, -1.845703125)|(54.18815548107151, -2.8125)|(51.481382896100975, -2.5927734375)|(51.31688050404585, 0.5712890625) which is seperated by | what i want to do is make a xml document from this and outputing like this <trkpt lat="56.728621973140726" lon="-1.845703125"> <<< the first 2 vars Then it would carry on down the page until or the vars are done. Can anybody help me please. Link to comment https://forums.phpfreaks.com/topic/152528-grabbing-what-i-need/ Share on other sites More sharing options...
urban Posted April 4, 2009 Author Share Posted April 4, 2009 Ok i have this now <?php $tt = ($_POST["routePoints"]); $ttt = explode("|", $tt); foreach ($ttt as $tttt) { $output = str_replace("(", "" , $tttt); $output1 = str_replace(")", "" , $output); print_r ( explode(",", $output1)); } ?> now i want to echo the vars into this one by one <trkpt lat="56.728621973140726" lon="-1.845703125"> <<< the first 2 vars Link to comment https://forums.phpfreaks.com/topic/152528-grabbing-what-i-need/#findComment-801132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.