English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
(PHP 5 >= 5.5.0)
curl_unescape — URL 인코딩된 문자열을 복호화합니다.
string curl_unescape ( resource $ch , string $str )
URL 인코딩된 문자열을 복호화합니다.
주의:curl_unescape()는 플러스 기호 (+)를 복호화할 수 없습니다.+)은 공백으로 설정할 수 있으며, urldecode()를 사용할 수 있습니다.
ch
curl_init()에서 반환된 CURL 핸들
str
URL 인코딩된 문자열
복호화된 문자열을 반환하거나 실패 시 FALSE를 반환합니다.
<?php // curl 핸들 생성 $ch = curl_init('http://example.com/redirect.php'); // HTTP 요청 보내기 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_exec($ch); // 마지막 유효한 URL 가져오기 $effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); // 예: "http://example.com/show_location.php?loc=M%C3%BCnchen" // URL 복호화 $effective_url_decoded = curl_unescape($ch, $effective_url); // "http://example.com/show_location.php?loc=München" // 핸들 닫기 curl_close($ch); ?>