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); ?>