note 20355 added to function.parse-str
| From: | admin at CdnDomainRegistry dot ca | Date: | Mon, 01 Apr 2002 02:31:29 +0000 |
| Subject: | note 20355 added to function.parse-str | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28441@lists.php.net to get a copy of this message | ||
When returning the results of parse_str() to an array,
the key will be renamed if it contains a period.
$str = "first=value&second[]=this+works&per.iod[]=another";
parse_str($str, $newArray);
echo $newArray;
/* prints "Array" */
echo $newArray['second']['0'];
/* prints "this works" */
echo $newArray['per.iod']['0'];
/* "Undefined index: per.iod " */
/* however...*/
echo $newArray['per_iod']['0']; /* prints "another" */
/* notice the array key has been renamed from per.iod to per_iod */
Glen
--
http://www.php.net/manual/en/function.parse-str.php
http://master.php.net/manage/user-notes.php?action=edit+20355
http://master.php.net/manage/user-notes.php?action=delete+20355
http://master.php.net/manage/user-notes.php?action=reject+20355