note 28192 deleted from function.parse-url by didou

From: Date: Thu, 09 Oct 2003 13:28:10 +0000
Subject: note 28192 deleted from function.parse-url by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58127@lists.php.net to get a copy of this message
Note Submitter: yoshipp@terra.es ---- 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; }

« previous php.notes (#58127) next »