PHP - 移除標籤函式



語法

string strip_tags ( string $str [, string $allowable_tags ] )

定義和用法

它用於從字串中移除 HTML 和 PHP 標籤。

返回值

它返回已移除標籤的字串

引數

序號 引數和描述
1

字串

指定要檢查的字串

2

允許

指定允許的標籤

示例

嘗試以下示例

<?php
   echo strip_tags("Tutorials <b><i>Point</i></b>","<b>");
?>

這將產生以下結果 -

Tutorials Point
php_function_reference.htm
廣告