note 89565 deleted from function.parse-str by nikic
| From: | nikic@php.net | Date: | Thu, 23 Aug 2012 11:19:48 +0000 |
| Subject: | note 89565 deleted from function.parse-str by nikic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190185@lists.php.net to get a copy of this message | ||
Note Submitter: zspencer at zacharyspencer dot com
----
Also, an FYI but you cannot define arr when you call the function. I.E
<?php
$string="Tom=You&Zach=Me";
parse_str($string,$array);
print_r($array);
// Undefined variable $array on line 2!!!!
?>
However, if you define the array before hand, it works.
<?php
$string="Tom=You&Zach=Me";
$array=array();
parse_str($string,$array);
print_r($array);
/*
Array
(
[Tom] => You
[Zach] => Me
)
*/
?>