Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CSV ファイルから取得される次の ASCII 文字列を検討してください。
Foo\xe2\x80\x99s Bar
PHPを使用して、値が次のようになるように、これを確実にUTF-8に変換するにはどうすればよいですか。
Foo’s Bar
として印刷された文字列値を取得する場合Foo\xe2\x80\x99s Bar、php では文字列を次のように定義できます。
$str = "Foo\\xE2\\x80\\x99s Bar";
メソッドをFoo’s Bar使用して文字列を出力できます。eval()
eval()
eval("\$value = \"Foo\\xE2\\x80\\x99s Bar\";"); echo $value;
結果表示Foo’s Bar。