我是新來的PHP
這裏是我的代碼
<p>The filetype you are attempting to upload is not allowed.</p>
預期的輸出:
The filetype you are attempting to upload is not allowed.
如何刪除標籤<p>
?
我是新來的PHP
這裏是我的代碼
<p>The filetype you are attempting to upload is not allowed.</p>
預期的輸出:
The filetype you are attempting to upload is not allowed.
如何刪除標籤<p>
?
使用strip_tags()
刪除HTML標籤
http://php.net/manual/en/function.strip-tags.php
echo strip_tags("<p>The filetype you are attempting to upload is not allowed.</p>");
會給你The filetype you are attempting to upload is not allowed.
使用strip_tags()
從您的字符串剝離HTML標籤
例
$strip = '<p>The filetype you are attempting to upload is not allowed.</p>';
echo strip_tags($strip);
$string= '<p>The filetype you are attempting to upload is not allowed.</p>';
$new_string = strip_tags($string);
$str= '<p>The filetype you are attempting to upload is not allowed.</p>';
$new_string = strip_tags($str);
'谷歌是你對這樣的基本查詢friend' – asprin
的確,我建議你快速瀏覽一下從這個字符串函數列表http://php.net /manual/en/ref.strings.php –