??PHP??????url_encode
??,?????????:
function custom_url_encode($string) {
$entities = array('!', '*', ''', '(', ')', ';', ':', '@', '&', '=', '+', '$', ',', '/', '?', '%', '#', '[', ']');
$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($entities, $replacements, urlencode($string));
}
// ????
$url = "https://example.com/test?query=????¶m=value";
$encoded_url = custom_url_encode($url);
echo $encoded_url;
??????custom_url_encode
??????urlencode
?????????????,????str_replace
????????????????,?????PHP?????????url_encode
????