X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=2d4fcf45df00abd20358f9515859241ca8e889f6;hb=247435718942b91af153c729c0347be3af1fecf9;hp=6bf29c4d55a029c564f6c86a177eea2e803b1fe8;hpb=078590fc4b01f658f525c09025165fde47aeee3d;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 6bf29c4d55..2d4fcf45df 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3576,5 +3576,29 @@ if (!function_exists('html_entity_decode')) { } } // END - if +if (!function_exists('http_build_query')) { + // Taken from documentation on www.php.net, credits to Marco K. (Germany) + function http_build_query($data, $prefix='', $sep='', $key='') { + $ret = array(); + foreach ((array)$data as $k => $v) { + if (is_int($k) && $prefix != null) { + $k = urlencode($prefix . $k); + } // END - if + + if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']'; + + if (is_array($v) || is_object($v)) { + array_push($ret, http_build_query($v, '', $sep, $k)); + } else { + array_push($ret, $k.'='.urlencode($v)); + } + } // END - foreach + + if (empty($sep)) $sep = ini_get('arg_separator.output'); + + return implode($sep, $ret); + } +}// // END - if + // [EOF] ?>