rawurldecode rawurldecode parse_url 总结

echo  "<hr>";
echo   "输出:<br>";
echo   'sales   and   marketing/Miami ';
echo   " <br> ";
echo   rawurlencode( 'sales   and   marketing/Miami 汉字'); //空格         汉字  特殊字符  变成%加16进制,
echo   " <br> ";
echo   urlencode( 'sales   and   marketing/Miami汉字 '); //空格变成+号      汉字  特殊字符  变成%加16进制,
echo   " <br> ";
echo    print_r( parse_url( 'http://www.baidu.com:80/?k=sales   and   marketing/Miami 汉字&y=3432&z=434'));//以数组形式返回

 

输出:
sales and marketing/Miami
sales%20%20%20and%20%20%20marketing%2FMiami%20%E6%B1%89%E5%AD%97
sales and marketing/Miami汉字
Array ( [scheme] => http [host] => www.baidu.com [port] => 80 [path] => / [query] => k=sales and marketing/Miami 汉字&y=3432&z=434 ) 1

你可能感兴趣的:(rawurldecode rawurldecode parse_url 总结)