Q:

How to echo richtext paragraph in plain text. No headers, No Images, No iframes

I created a blogging CMS from scratch with a homepage layout similar to a Wordpress blog page. I published articles with images, embeded youtube videos, headings,etc (rich text formatting). Now on the homepage where I echo only 495 characters, youtube videos, images and headers bigger than the homepage's main heading size show up.
How can I echo the post from the database(with richtext) without iframes, images and headers n a paragraph?

A:

use strip_tags() with allowed tags like this:
<?php
$new_text=strip_tags($old_text,'<p><a>'); #which it allows <p> and <a> tags
?>

More Info on php.net

