note 95942 added to function.urldecode
| From: | chrisstocktonaz at gmail dot com | Date: | Fri, 29 Jan 2010 18:39:38 +0000 |
| Subject: | note 95942 added to function.urldecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165498@lists.php.net to get a copy of this message | ||
I was looking for a fast way to build a string dsn from a key => value pair array. I came up with
the following, simple enough for my purposes.
<?php
$dsn = Array(
'host' => 'localhost',
'port' => 80,
'user' => 'foo',
'pass' => 'R(I%!JAKSJ(asd'
);
$dsn = urldecode(http_build_query($dsn, NULL, ';'));
var_dump($dsn); // host=localhost;port=80;user=foo;pass=R(I%!JAKSJ(asd
----
Server IP: 64.71.164.2
Probable Submitter: 64.202.160.65
----
Manual Page -- http://www.php.net/manual/en/function.urldecode.php
Edit -- https://master.php.net/note/edit/95942
Del: integrated -- https://master.php.net/note/delete/95942/integrated
Del: useless -- https://master.php.net/note/delete/95942/useless
Del: bad code -- https://master.php.net/note/delete/95942/bad+code
Del: spam -- https://master.php.net/note/delete/95942/spam
Del: non-english -- https://master.php.net/note/delete/95942/non-english
Del: in docs -- https://master.php.net/note/delete/95942/in+docs
Del: other reasons-- https://master.php.net/note/delete/95942
Reject -- https://master.php.net/note/reject/95942
Search -- https://master.php.net/manage/user-notes.php