Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
Web
curl_get($url, $raw=false)
httppost($url, $data)
http_build_query($array) & http_raw_query
http_raw_query($formdata, ..)
4
found
auth
Name:
Category: Web
Body:
# a better one, useful in PHP5 also; gratefully st^Wcopied and adapted from http://php.net/http-build-query#57480 # Uses rawurlencode(). The numeric prefix shouldn't be needed, but is pretty smart. #_____________________________________________________________ # http_raw_query($formdata, $numeric_prefix=null, $key=null) / function http_raw_query($formdata, $numeric_prefix=null, $key=null) { $res = array(); foreach((array) $formdata as $k => $v) { $tmp_key = rawurlencode(is_int($k) ? $numeric_prefix.$k : $k); if ($key) $tmp_key = $key.'['.$tmp_key.']'; $res[] = ( (is_array($v) || is_object($v)) ? http_raw_query($v, null, $tmp_key) : $tmp_key."=".rawurlencode($v) ); } $separator = ini_get('arg_separator.output'); return implode($separator, $res); }
Footer