note 33741 deleted from function.parse-str by nikic
| From: | nikic@php.net | Date: | Thu, 23 Aug 2012 11:08:14 +0000 |
| Subject: | note 33741 deleted from function.parse-str by nikic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190181@lists.php.net to get a copy of this message | ||
Note Submitter: dante at lorenso dot com
----
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