Then you won't need any of the fancy custom utf_urldecode functions from the previous comments. プログラミング言語PHPで、指定した文字列をURLエンコード・デコードする関数 urlencode()、urldecode()を紹介します。 PHPの配列をマスターしよう!【基本から初心者向け】 65,965 views. phpの「urlencode()」を使用すれば、日本語文字列をエンコードすることができます。 また、逆にURLエンコードされた文字列をデコードする場合は「urldecode()」を使用します。 phpのurlencode、urldecode関数を使用して、エンコードとデコードをする方法をメモします。 PHP $_SESSION(セッション変数)のすべて!【初心者向け基本】 55,352 views. PHP $_POST(ポスト変数 )のすべて!【初心者向け基本】 65,216 views. I'm running PHP version 5.0.5 and urlencode() doesn't seem to encode the "#" character, although the function's description says it encodes "all non-alphanumeric" characters. おすすめページ .
If you are escaping strings in javascript and want to decode them in PHP with urldecode (or want PHP to decode them automatically when you're putting them in the query string or post request), you should use the javascript function encodeURIComponent() instead of escape(). This was a particular problem for me when trying to open local files with a "#" in the filename as Firefox will interpret this as an anchor target (for better or worse). PHP HTMLタグ PHPタグ を除去・削除したい strip_tags() 4,886 views.