php - Working with ampersands in $_GET functions -


if have url asdf.com/index.php?a=0&b=2, using $_get a 0 , b 2. however, term put single $_get function has ampersand in already, a=steak&cheese. there way make ampersands work without $_get variable thinking job ends when ampersand shows (therefore not pulling entire term)?

urlencode() & turns %26.

if need make query string out of parameters, can use http_build_query() instead , url encode parameters you.

on receiving end, $_get values decoded php, query string a=steak%26cheese corresponds $_get = array('a' => 'steak&cheese').


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -