note 124974 added to function.rawurldecode

From: Date: Sat, 02 May 2020 22:32:36 +0000
Subject: note 124974 added to function.rawurldecode
Groups: php.notes 
Request: Send a blank email to php-notes+get-214574@lists.php.net to get a copy of this message
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 ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.195 (proxied: 46.161.235.24) ---- Manual Page -- http://php.net/manual/en/function.rawurldecode.php Edit -- https://master.php.net/note/edit/124974 Del: integrated -- https://master.php.net/note/delete/124974/integrated Del: useless -- https://master.php.net/note/delete/124974/useless Del: bad code -- https://master.php.net/note/delete/124974/bad+code Del: spam -- https://master.php.net/note/delete/124974/spam Del: non-english -- https://master.php.net/note/delete/124974/non-english Del: in docs -- https://master.php.net/note/delete/124974/in+docs Del: other reasons-- https://master.php.net/note/delete/124974 Reject -- https://master.php.net/note/reject/124974 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214574) next »