How to Get the whole query string text from address bar

In PHP you can get the query string text with is separated by URL via '?' character. For this you can use 'query_string' with server variable.

So you can use it like


echo $_SERVER['QUERY_STRING'];
?>

So, for following URL in address bar:-
www.mobifonz.com?var1=3&var3=this

Output will be:-
var1=3&var3=this

And for following URL in address bar:-
www.mobifonz.com?this_Is_Some_Text

Output will be:-
this_Is_Some_Text

Means it will return anything after the '?' sign.

Posted in |