Skip to content
Advertisement

PHP get user id in url 4

I want to get the id from my url like below

http://localhost/cpanel-ar/stage_one/reports.php?temp=temp_21day

How can GET only the “temp”?

Advertisement

Answer

I assume that you mean this:

$getVars = array_keys($_GET);

print_r($getVars);

This will return an array with your get parameters. for example:
http:example.com?getparameter=getvalue returns:

Array ( [0] => getparameter )  
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement