void parse_str ( string str [, array &arr] ) take a query string and convert it to variables : parse_str « Utility Function « PHP






void parse_str ( string str [, array &arr] ) take a query string and convert it to variables

 
<?
    if (isset($foo)) {
            print "Foo is $foo<br />";
    } else {
            print "Foo is unset<br />";
    }

    parse_str("foo=bar&bar=baz");

    if (isset($foo)) {
            print "Foo is $foo<br />";
    } else {
            print "Foo is unset<br />";
    }
?>
  
  








Related examples in the same category

1.Pass an array as the second parameter to parse_str( ), and it will put the variables into there