php - how to get all global variable -


instead of using $_post['var'] globals name.

also example have <input type='text' name='surname'> when submit form use get('surname') instead of $_post['surname'] tried function 1 not work

function get($var){     $global = $globals["$var"] ;     return $global; } 

i not understand why.

i return me notice: undefined index: nom in c:\wamp\www\cyb.fr\lib_php\librairie.php on line 23

anykind of appreciated

you can use below function:

function post_value($key=''){ if($key!='')    {     if(!is_array($_post[$key]))             return trim($_post[$key]);         else             return $_post[$key];  } else     return; } 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -