php
Convert HTML code to plain text in PHP
<?php
$html_code = '<p>Hello world</p>'
echo strip_tags($html_code);
?>
You can use strip_tags() function to convert HTML code to plain text in PHP. This will remove the basic HTML tags from the string and will return plain text string.
Was this helpful?
Similar Posts
- Encode html special characters and real escape string in php
- Editorjs blocks - JSON to HTML PHP
- Capitalize text PHP
- Set HTTP response code in php
- Convert characters to lowercase using strtolower() function in PHP
- Convert String date to DATE MONTH-NAME YEAR format php
- Convert Mysql date to Google sitemap date format PHP