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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -