从 WordPress 打印的内容中删除 HTML 代码

use*_*021 2 php wordpress

我使用以下代码打印特定帖子的内容(在本例中为 103):

<?php $post_id = 103; $queried_post = get_post($post_id); echo apply_filters('the_content',$queried_post->post_content); ?>
Run Code Online (Sandbox Code Playgroud)

我怎样才能让它排除所有 html 标签,如<p><br>s,只显示文本?

谢谢!

bug*_*s94 5

使用 strip_tag(string) 函数从字符串中删除所有 html 标签

echo strip_tags(apply_filters('the_content',$queried_post->post_content));
Run Code Online (Sandbox Code Playgroud)