note 70180 modified in function.urldecode by bobby

From: Date: Thu, 19 Oct 2006 14:46:39 +0000
Subject: note 70180 modified in function.urldecode by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-118765@lists.php.net to get a copy of this message
Here is a rewritten example that does the same thing but runs cleaner. <?php $a = explode('&', $QUERY_STRING); foreach($a as $key => $b) { $b = split('=', $b); echo 'Value for parameter '.htmlspecialchars(urldecode($b[0])).' is '.htmlspecialchars(urldecode($b[1]))."<br />\n"; } ?> --was-- The example provided is very poorly written (in my opinion). Here is a rewritten example that does the same thing but runs cleaner. <?php $a = explode('&', $QUERY_STRING); foreach($a as $key => $a) { $b = split('=', $a); echo 'Value for parameter '.htmlspecialchars(urldecode($b[0])).' is '.htmlspecialchars(urldecode($b[1]))."<br />\n"; } ?> http://php.net/manual/en/function.urldecode.php

« previous php.notes (#118765) next »