php - How to write a function similar to $_GET? -
is there function works $_get ? mean function transforms
"?var1=5&var2=true"
to
$var1=5; $var2="true";
so can use 1 variable (string) in function , fetch many variables it?
like:
function manual_get($args){ /* ? */} function myfunction($args) { manual_get($args); if(isset($var1))/* doesn't have way, btw */ { do_something($var1); } //etc }
p.s. : don't want use $_get url because file class file (namely database_library.php) don't execute directly, or make ajax call. require_once();
it.
yes, there is. called parse_str
: http://php.net/manual/en/function.parse-str.php
Comments
Post a Comment