note 124974 deleted from function.rawurldecode by cmb

From: Date: Sun, 03 May 2020 09:54:58 +0000
Subject: note 124974 deleted from function.rawurldecode by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-214576@lists.php.net to get a copy of this message
Note Submitter: yemenvibe at gmail dot com ---- Once the string passed to the server side finally gets exploded into an array (or set of such), you could use the following function to recursively rawurldecode the array(s): <?php function rawurldecode_array(&$arr) { foreach (array_keys($arr) as $key) { if (is_array($arr[$key])) { rawurldecode_array($arr[$key]); } else { $arr[$key] = rawurldecode($arr[$key]); } } } $a[0] = rawurlencode("2+1:3?9"); $a["k"] = rawurlencode("@:-/"); $a[-3][0] = rawurlencode("+"); $a[-3][2] = rawurlencode("=_~"); $a[-3]["a"] = rawurlencode("this+is a%test"); echo "<pre>"; print_r($a); echo "</pre>"; rawurldecode_array($a); echo "<pre>"; print_r($a); echo "</pre>"; ?> https://yemenvibe.com

« previous php.notes (#214576) next »