Suppose someone submits this URL to my site: http://maps.google.com/?ie=UTF8&ll=39.143774,-94.577351&spn=0.0448,0.080338&z=14 &layer=c&cbll=39.12826,-94.577457&cbp=1,293.8834236345768,,0,1.979445749803011 And then that whole string is stored in "$url_submitted" How can I pull out some of those individual numbers to store? For example, I want the two numbers in the "cbll" to be stored separately (say in $a and $b), and I want the items in "cbp" to be stored separately (say in $c, $d, $e and $f). How would I go about doing this? Thanks!
Look into the preg_match and preg_match_all functions, and familiarize yourself with Regular Expressions (called 'regex' for short). Just a quick little example (might run, might not . . . doing this straight off the top of my head. Correct any errors for yourself ) <? // get the cbll preg_match("/cbll=.*&cbp/", $url_submitted, $matches); print_r($matches); // print the matches, do whatever you want with them // you could make the regex above better, but i'm tired and have been // coding for 5 hours straight so, again i'll leave this to you and simply // str_remove the excess baggage $remove = array("cbll=", "&cbp"); $cbll = str_replace($remove, "", $matches[0]); ?> PHP: Hope that helps