SOLVED!

First of all, thanks for all the hints! I have talked to a good friend
and great PHP programmer, Nasair Junior da Silva, who proposed a regex
based approach. Here is the solution, in the poli_xml.php file:

while ($row = @pg_fetch_assoc($result)){
$resultado=$row[limite];
$resultado=str_replace("))",")]",$resultado);
$resultado=str_replace(",","<br>",$resultado);
// the following regex switches the elements before and after the
space " "
// thanks to Nasair JĂșnior da Silva <[EMAIL PROTECTED]>
$resultado = preg_replace(';([-0-9\.]+)[ ,]([-0-9\.-]+);','\2 \1',
$resultado);
$resultado=str_replace(" ",",",$resultado);
$resultado=str_replace("POLYGON(","[new GLatLng",$resultado);
$resultado=str_replace("<br>","), new GLatLng(",$resultado);
$resultado="<markers><marker bairro=\"".$resultado."\" /></markers>";
echo $resultado;

Simple and elegant! I hope this can help more newbies like me!

Thanks, Nasair (he is copied here!).

Joice
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to