From f66ae301b8ff154e009afd02258551787cae683c Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Thu, 14 Jun 2012 10:04:13 -0400 Subject: network: fix bug #453 --- boot.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index bf4e59293..e535c171f 100644 --- a/boot.php +++ b/boot.php @@ -1577,3 +1577,30 @@ function zrl($s,$force = false) { return $s . $achar . 'zrl=' . urlencode($mine); return $s; } + +/** +* returns querystring as string from a mapped array +* +* @param params Array +* @return string +*/ +function build_querystring($params, $name=null) { + $ret = ""; + foreach($params as $key=>$val) { + if(is_array($val)) { + if($name==null) { + $ret .= build_querystring($val, $key); + } else { + $ret .= build_querystring($val, $name."[$key]"); + } + } else { + $val = urlencode($val); + if($name!=null) { + $ret.=$name."[$key]"."=$val&"; + } else { + $ret.= "$key=$val&"; + } + } + } + return $ret; +} -- cgit v1.2.3