When I ran your code I got several compile errors:
var vs vars was already discussed
It also complained about sd not being quoted in $_GET[sd]. There's no excuse for ignoring an error like that, just fix it.
Finally i see this:
Notice: Undefined variable: _GET in :\Inetpub\wwwroot\test.php on line 11
That should tell you the problem, the variable variable you defined does not exist (why? because it is a global, but you have not declared the variable variable to be a global).
Here is a fixed version of your code:
function vars(){
global $_GET;
//array var
$var_name = "sd";
//array name
$array_name = "_GET";
// pass array to another string
global $$array_name;
$value = $$array_name;
// call array from second string and with orignal string.
echo $value[$var_name]."<br>".$_GET['sd']."<br>";
}
But here's a more sensible way to to the same thing (you don't need globals or variable variables at all):
function vars($value){
//array var
$var_name = "sd";
//array name
// call array from parameter and with orignal string.
echo $value[$var_name]."<br>".$_GET['sd']."<br>";
}
vars($_GET); // call function