Anenlyvensusy
New Member
\[quote\] Possible Duplicate:
PHP split alternative? \[/quote\]\[code\] // Successful geocode$geocode_pending = false;$coordinates = $xml->Response->Placemark->Point->coordinates;$coordinatesSplit = split(",", $coordinates);// Format: Longitude, Latitude, Altitude $lat = $coordinatesSplit[1];$lng = $coordinatesSplit[0];\[/code\]Hello People, this is a part of my geolocation code. I try to change a stored adress into a lat/long and than save the lat/long back in the database. They use the split function to put a string in an array but since php 5.3.0 the function is deprecated.Anyone has a solution for this?Thank youEDIT:When i use this\[code\]$coordinatesSplit = preg_split(",", $coordinates);\[/code\]I receive following error\[quote\] preg_split() [function.preg-split]: No ending delimiter\[/quote\]LAST editWhen i add something to the database, the long/late are automatically saved to. But when i want to add for example the 6th adress in the database, the script to generate the lat/long is automatically doing this over all the records in the database. Is there any posibility to do this only at the last added? ----> Geolocation LONG/LAN in database
PHP split alternative? \[/quote\]\[code\] // Successful geocode$geocode_pending = false;$coordinates = $xml->Response->Placemark->Point->coordinates;$coordinatesSplit = split(",", $coordinates);// Format: Longitude, Latitude, Altitude $lat = $coordinatesSplit[1];$lng = $coordinatesSplit[0];\[/code\]Hello People, this is a part of my geolocation code. I try to change a stored adress into a lat/long and than save the lat/long back in the database. They use the split function to put a string in an array but since php 5.3.0 the function is deprecated.Anyone has a solution for this?Thank youEDIT:When i use this\[code\]$coordinatesSplit = preg_split(",", $coordinates);\[/code\]I receive following error\[quote\] preg_split() [function.preg-split]: No ending delimiter\[/quote\]LAST editWhen i add something to the database, the long/late are automatically saved to. But when i want to add for example the 6th adress in the database, the script to generate the lat/long is automatically doing this over all the records in the database. Is there any posibility to do this only at the last added? ----> Geolocation LONG/LAN in database