2012-12-07 22 views
-1

其實我想所有的特殊字符到他們的代碼轉換成html特殊字符轉換成他們的代碼,因爲我已經如下圖所示:如何使用PHP

! !  
" " 
# #  
$ $  
% %  
& & 
' '  
( (  
) )  
* *  
+ +  
, ,  
- -  
. .  
/ / 

有沒有辦法將它們轉換爲尊重碼在PHP中。

回答

-1

在PHP中有一些稱爲html_entity_decodehtmlentities的函數。

+0

將它的字符「轉換成" ???? –

+0

伴侶,只是到這裏,並檢查自己:http://php.net/manual/en/function.htmlentities.php有不同的方式來對事物進行編碼,找到你想要的東西 – sashkello

+0

還有可能更接近你的目標的htmlspecialchars。 – sashkello

-1
$str="&#33"; 
echo html_entity_decode($str); //output !