url_encode
? url_decode
? PHP ????? URL ???????????????????????? URL ???????????????????????
url_encode
:???????????? URL ????????????(???????)???%
?????????,??? URL ????
??:
$string = "Hello, World!"; $encoded_string = urlencode($string); echo $encoded_string; // ??:Hello,+World!
url_decode
:????????url_encode
??????????????????%
???????????????????
??:
$encoded_string = "Hello,+World!"; $decoded_string = urldecode($encoded_string); echo $decoded_string; // ??:Hello, World!
???? url_encode
? url_decode
???????????????????????????????????????? URL ?,???? url_encode
?????????,??????????????,???? url_decode
???????
??:
// ??? $search_query = "Hello, World!"; $encoded_query = urlencode($search_query); $url = "https://example.com/search.php?q=" . $encoded_query; // ??? (search.php) $decoded_query = urldecode($_GET['q']); echo $decoded_query; // ??:Hello, World!