Today, We want to share with you how to remove html tags from string in php?.In this post we will show you php remove html entities, hear for php remove html tags keep content we will give you demo and example for implement.In this post, we will learn about Delete Html tags from string PHP with an example.
Removing HTML from a string
Example 1: PHP strip_tags() Function
<!DOCTYPE html> <html> <body> <?php echo strip_tags("Welcome <b>Pakainfo!</b>"); ?> </body> </html>
Example 2:
<?php $str_data = "<blink><strong>Welcome!</strong></blink>"; $a = strip_tags($str_data); $b = strip_tags($str_data, "<strong><em>"); ?>
PHP Code
$str = '<p>Tamil Rockers.</p><!-- Comment --> <a href="#new_content">Love Website</a>'; echo strip_tags($str); //output Tamil Rockers. Love Website <?php echo substr(strip_tags($resoponse_user_bio_data['user_bio_data']),0,110) . "..."; ?>
I hope you get an idea about how to remove html tags from string in codeigniter.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, donโt forget to share.