Dear all,<br><br>I'm trying create two page variables from a new markup I've created (ref GeoTagging recipe in development). The markup is as follows and represents a comma separated latitude and longitude:<br><br>
(:coord 50.1234, -2.3456:)<br><br>I'm trying (and failing) to take the value from coord and split it to store two page variable called Latitude and Longitude. A logical example of what I'm trying is below. Obviously it doesn't work so only for illustrative purposes. I'd like to take the $FmtPV['$Coord'] and create $FmtPV['$Latitude'] and $FmtPV['$Longitude']. As you can see I'm using explode() via a function so I can extract element 0 (lat) and element 1 (lng).<br>
<br>$FmtPV['$Coord'] = '@$page["coord"]';<br>$SaveProperties[] = 'coord';<br>$FmtPV['$Latitude'] = 'function:GetLatFromCoord';<br>function GetLatFromCoord() {<br> $coordArr = explode(',',$FmtPV['$Coord']);<br>
return $coordArr[0];<br>}<br>$FmtPV['$Longitude'] = 'function:GetLngFromCoord';<br>function GetLngFromCoord() {<br> $coordArr = explode(',',$FmtPV['$Coord']);<br> return $coordArr[1];<br>
}<br><br>If this can done in a one-liner that would be even better. e.g.:<br> $FmtPV['$Latitude'] = 'explode(',',$FmtPV['$Coord'])'[0];<br>
$FmtPV['$Longitude'] = 'explode(',',$FmtPV['$Coord'])'[1];<br>
<br>Thanks in advance for any pointers.<br>--Steve.<br>