note 34502 added to function.parse-str

From: Date: Tue, 29 Jul 2003 12:17:22 +0000
Subject: note 34502 added to function.parse-str
Groups: php.notes 
Request: Send a blank email to php-notes+get-52923@lists.php.net to get a copy of this message
This func does the job even with multidimensional arrays, f.e. for passing them with a link. function Fs_ReParseStr($vars) { $out = "/"; $snd = false; if ( !is_array($vars) || count($vars) == 0 ) { return $out; } $fga = func_get_args(); if ( isset($fga[1],$fga[2]) && $fga[1] === true ) { $snd = true; } foreach ( $vars as $key=>$val ) { if ( !is_array($val) ) { $out .= ( ($snd) ? $fga[2]."[".$key."]" : $key ); $out .= "=".rawurlencode($val)."&"; } else { $key = ( ($snd) ? $fga[2]."[".$key."]" : $key ); $out .= Fs_ReParseStr($val,true,$key); } } return $out; } Hans Kuhln ---- Manual Page -- http://www.php.net/manual/en/function.parse-str.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34502 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34502&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34502&report=yes

« previous php.notes (#52923) next »