english/libraries/joomla/utilities/string.php
/**
	 * Does a UTF-8 safe version of PHP parse_url function
	 *
	 * @param   string  $url  URL to parse
	 *
	 * @return  mixed  Associative array or false if badly formed URL.
	 *
	 * @see     http://us3.php.net/manual/en/function.parse-url.php
	 * @since   11.1
	 */
Does a UTF-8 safe version of PHP parse_url function
@param   string  $url  URL to parse

@return  mixed  Associative array or false if badly formed URL.


Does a UTF - 8 safe version of PHP parse_url function @param string $url URL to parse @return mixed Associative array or false if badly formed URL .
public static function parse_url($url) {
		$result = array();
		$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
		$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "$", ",", "/", "?", "%", "#", "[", "]");
		$encodedURL = str_replace($entities, $replacements, urlencode($url));
		$encodedParts = parse_url($encodedURL);
		foreach ($encodedParts as $key => $value) {
			$result[$key] = urldecode($value);
		}
		return $result;
	}
public static function parse_url ( $ url ) { $ result = array ( ) ; $ entities = array ( '%21' , '%2A' , '%27' , '%28' , '%29' , '%3B' , '%3A' , '%40' , '%26' , '%3D' , '%24' , '%2C' , '%2F' , '%3F' , '%25' , '%23' , '%5B' , '%5D' ) ; $ replacements = array ( '!' , '*' , " ' " , " ( " , " ) " , " ; " , " : " , " @ " , " & " , " = " , " $ " , " , " , " / " , " ? " , " % " , " # " , " [ " , " ] " ) ; $ encodedURL = str_replace ( $ entities , $ replacements , urlencode ( $ url ) ) ; $ encodedParts = parse_url ( $ encodedURL ) ; foreach ( $ encodedParts as $ key => $ value ) { $ result [ $ key ] = urldecode ( $ value ) ; } return $ result ; }
Does a UTF-8 safe version of PHP parse_url function
 @param   string  $url  URL to parse
Does a UTF - 8 safe version of PHP parse_url function @param string $url URL to parse
// Build arrays of values we need to decode before parsing // Create encoded URL with special URL characters decoded so it can be parsed // All other charcters will be encoded // Parse the encoded URL // Now, decode each value of the resulting array