すべてのhtmlタグをテキストにバイパスする必要があります。すべてのhtmlタグをhtml形式のテキストにバイパスする方法があると確信しています。以下に例を示します。
例:
<p style="clear: both;"></p>
為に
<p style="clear: both;"></p>
何か機能?ありがとう :)
すべてのhtmlタグをテキストにバイパスする必要があります。すべてのhtmlタグをhtml形式のテキストにバイパスする方法があると確信しています。以下に例を示します。
例:
<p style="clear: both;"></p>
為に
<p style="clear: both;"></p>
何か機能?ありがとう :)
strip_tags
HTMLタグの削除に使用
$str = strip_tags("your string");
htmlタグを表示するためにhtmlspecialchars
htmlspecialchars("<html>something</html>"); // output <html>something</html>
あなたはおそらく次を探していますhtmlentities()
:
$str = htmlentities('<p style="clear: both;"></p>');
var_dump($str);
または、逆の方法でやりたい場合は、次を使用しますhtml_entity_decode()
。
$str = html_entity_decode('<p style="clear: both;"></p>');
var_dump($str);