note 48180 added to function.rawurlencode

From: Date: Tue, 14 Dec 2004 18:43:21 +0000
Subject: note 48180 added to function.rawurlencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-81790@lists.php.net to get a copy of this message
Be careful! rawurldecode()ing a string that has been rawurlencode()d will NOT return the original string, but the original string with slashes added. Example: <?php $s = 'hello"world'; echo rawurldecode(rawurlencode($s)); //outputs 'hello\"world' ?> To get the original string, you need to call stripslashes() on top of those two calls. <?php $s = 'hello"world'; echo stripslashes(rawurldecode(rawurlencode($s))); //outputs 'hello"world' ?> ---- Manual Page -- http://www.php.net/manual/en/function.rawurlencode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48180 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48180&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48180&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81790) next »