PHP

Posts about PHP

Having Trouble With Url Arrays?

Yesterday at work, I was having trouble passing multiple variables through the URL as a $_GET variable. If you're printing (print_r()) your variables and they are just coming out as strings of 'Array', try this:

//first grab the end of string
?var1[]=31&var1[]=57&var2=add $url = $_SERVER['QUERY_STRING']
 
//next use parse_str() to use the url to create the array

Syndicate content