Tags
PHP , HTML
Asked 3 years ago
9 Jul 2021
Views 489
Eusebio

Eusebio posted

Converting HTML to plain text in PHP for e-mail

Converting HTML to plain text in PHP for e-mail
eclipse-learner

eclipse-learner
answered Aug 23 '21 00:00

strip_tags() function can be used to remove all tags from the HTML and return text .

how to use strip_tags() ?

$html = '<p> this is testing for strip_tags()</p>';
echo strip_tags($html);


you simply need to pass the HTML to strip_tags() as an argument and it removes all HTML tags and returns only texts

i am not sure how you get mail HTML from the mail provider. Good luck !!
Post Answer