我有一个带Code Decimal
的字符串,希望像这样转换:
当前刺痛:
24⃧ Guage Rake;
并且想要像这样转换:
24" Guage Rake
我尝试过这个,但没有得到正确的结果:
$string = "hello⃧";
htmlspecialchars_decode($string, ENT_NOQUOTES);
有什么想法吗?
感谢
htmlspecialchars_decode()
只更改一些字符,如引号。
您需要使用html_entity_decode()
。此外,"hello⃧"
缺少分号。应为"hello⃧"
"hello″"
。
试试这个:
header("Content-Type: text/plain; charset=UTF8");
$string = "hello″";
$string = html_entity_decode($string, ENT_NOQUOTES);
echo $string;
尝试使用html_entity_decode:
<?php
$string = '24 - your entity: -> ″ <- - Guage Rake;';
$decoded = html_entity_decode($string);
echo "$decoded'n";