?PHP?,?????????URL???????????????:
- ??
urlencode()
??:?????????????URL????,??????????%xx?????:
$url = "https://example.com/search?q=" . urlencode("????"); echo $url; // ??:https://example.com/search?q=你好世界
- ??
base64_encode()
??:?????????????Base64???????,?????????URL????:
$url = "https://example.com/search?q=" . base64_encode("????"); echo $url; // ??:https://example.com/search?q=5L2g5aW977yM5LiW55WM
- ??
http_build_query()
??:??????????????URL????????:
$params = array( 'q' => '????', 'lang' => 'zh-CN' ); $query = http_build_query($params); $url = "https://example.com/search?" . $query; echo $url; // ??:https://example.com/search?q=你好世界&lang=zh-CN
- ?????????:?????????????????URL?????,?????????????????????(?AES)????,??????????????????
????????,???????????????????,?????????URL???