PHP - htmlspecialchars_decode 函式



語法

string htmlspecialchars_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 ] )

定義和用法

它用於將特殊的 HTML 實體轉換回字元。

返回值

它返回解碼後的字串。

引數

序號 引數和描述
1

字串

包含輸入字串的資訊

2

標誌

包含標誌的資訊

示例

嘗試以下示例

<?php
   $str = "<p>tutorials -> </p>\n";
   
   echo htmlspecialchars_decode($str);
?>

這將產生以下結果:

tutorials -> "
php_function_reference.htm
廣告