Lets say I have a url that is something like: http://www.mydomain.com/index.php?data=1,1
I was wondering, once I get date with $_GET how do I split that into two variables and it would split at the "," so that one variable is 1 and so is the other 1; without the comma in either variable.
Thank you in advance.
[man]split[/man]
explode()
Both the above are good. A more unusual way of doing it is:
$code = "".$_GET['data']; var_one = $code{0} var_two = $code{2}
which works providng the info always comes through as two 1 digit vars
I'd agree with installer and recommend explode() since split() is a regular expression function, which is probably far more than you need.