note 99397 added to function.http-build-query

From: Date: Sun, 15 Aug 2010 10:22:29 +0000
Subject: note 99397 added to function.http-build-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-171684@lists.php.net to get a copy of this message
Further to valdikss at gmail dot com, here's a version that also honours the original signature <?php function http_build_query_alt(array $array, $numericPrefix = '', $argSeparator = null, $deep = false) { if ($argSeparator === null) $argSeparator = ini_get('arg_separator.output'); $result = array(); foreach ($array as $key => $value) { if ($deep) $key = $numericPrefix . '[]'; elseif (is_int($key)) $key = $numericPrefix . $key; if (is_array($value) || is_object($value)) { $result[] = http_build_query_alt($value, $key, $argSeparator, true); continue; } $result[] = urlencode($key) . '=' . urlencode($value); } return implode($argSeparator, $result); } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 59.100.99.61 ---- Manual Page -- http://www.php.net/manual/en/function.http-build-query.php Edit -- https://master.php.net/note/edit/99397 Del: integrated -- https://master.php.net/note/delete/99397/integrated Del: useless -- https://master.php.net/note/delete/99397/useless Del: bad code -- https://master.php.net/note/delete/99397/bad+code Del: spam -- https://master.php.net/note/delete/99397/spam Del: non-english -- https://master.php.net/note/delete/99397/non-english Del: in docs -- https://master.php.net/note/delete/99397/in+docs Del: other reasons-- https://master.php.net/note/delete/99397 Reject -- https://master.php.net/note/reject/99397 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#171684) next »