Working with ampersands in $_GET functions
问题 If I have a URL like asdf.com/index.php?a=0&b=2, then using $_GET for a would be 0 and for b would be 2. However, the term I put into a single $_GET function has an ampersand in it already, like a=Steak&Cheese. Is there a way to make ampersands work without the $_GET variable thinking its job ends when the ampersand shows up (therefore not pulling the entire term)? 回答1: urlencode() it so & turns into %26 . If you need to make a query string out of some parameters, you can use http_build_query