[转载] 网址方向转换转义符

1 $arr = array("&nbsp;"=>"20%","!"=>"21%","\""=>"22%","#"=>"23%","$"=>"24%","%"=>"25%","&"=>"26%","'"=>"27%","("=>"28%",")"=>"29%","*"=>"%2A ","+"=>"%2B ",","=>"%2C ","-"=>"%2D ","."=>"%2E ","/"=>"%2F ",":"=>"%3A ",";"=>"%3B ","<"=>"%3C ","="=>"%3D ",">"=>"%3E ","?"=>"%3F ","@"=>"40%","["=>"%5B ","]"=>"%5D ","^"=>"%5E ","_"=>"%5F ","`"=>"60%","{"=>"%7B ","|"=>"%7C ","}"=>"%7D ","~"=>"%7E");
2 
3 $strecho = "https://i.cnblogs.com/?url=".str_ireplace(" ","",strtr($keyword,$arr));

 

posted @ 2017-09-30 12:52  784040932  阅读(141)  评论(0编辑  收藏  举报