note 28192 added to function.parse-url

From: Date: Sun, 05 Jan 2003 18:52:08 +0000
Subject: note 28192 added to function.parse-url
Groups: php.notes 
Request: Send a blank email to php-notes+get-41691@lists.php.net to get a copy of this message
Why is not implemented the inverse or parse_url in the library? Anyway, I suppose this is a simple way to implement it: // Reverse of parse_str. // Recives hash array and returns string with query format function encode_str( $elems ) { $str = ''; while( list($key,$value) = each($elems) ) { $str .= ( $str=='' ? '' : '&' ); $str .= $key.'='.urlencode($value); } return $str; } -- http://www.php.net/manual/en/function.parse-url.php http://master.php.net/manage/user-notes.php?action=edit+28192 http://master.php.net/manage/user-notes.php?action=delete+28192 http://master.php.net/manage/user-notes.php?action=reject+28192

« previous php.notes (#41691) next »