Editing data in PHP
Posted: Thu Feb 16, 2006 3:48 pm
Allright, I'm working with some Google Maps crap with Zip codes and all. There's a site called GeoCoder.Us that allows you to look up places and get the Lat/Long.
With that being said, you can use a custom URL with the zipcode to get that particular Lat/Long info:
Ex: Go to this URL...: http://geocoder.us/service/csv/geocode?zip=95472
...and it will give you this string of text:
38.393314, -122.83666, Sebastopol, CA, 95472
I want to take the returned string of text above and chop everything after the second "," off so that I just end up with: 38.393314, -122.83666
That way I can plug it into Google Maps using a variable.
Any ideas? I just need the PHP code to chop off everything that second "," comma everytime. Thanks.
With that being said, you can use a custom URL with the zipcode to get that particular Lat/Long info:
Ex: Go to this URL...: http://geocoder.us/service/csv/geocode?zip=95472
...and it will give you this string of text:
38.393314, -122.83666, Sebastopol, CA, 95472
I want to take the returned string of text above and chop everything after the second "," off so that I just end up with: 38.393314, -122.83666
That way I can plug it into Google Maps using a variable.
Any ideas? I just need the PHP code to chop off everything that second "," comma everytime. Thanks.