note 33741 added to function.parse-str
| From: | dante at lorenso dot com | Date: | Sun, 06 Jul 2003 03:11:04 +0000 |
| Subject: | note 33741 added to function.parse-str | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51576@lists.php.net to get a copy of this message | ||
You can perform the opposite of this function if you like with a function like I've built
below:
/**
* Reverse of parse_str(). Converts array into
* string with query format
*/
function query_str ($params) {
$str = '';
foreach ($params as $key => $value) {
$str .= (strlen($str) < 1) ? '' : '&';
$str .= $key . '=' . rawurlencode($value);
}
return ($str);
}
-- Dante
----
Manual Page -- http://www.php.net/manual/en/function.parse-str.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33741
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33741&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33741&report=yes