i am showing the emails on my website php page through gamil api the api give me the html of the mails this mail html distrube my wesbite page html i am using below code for the displaying the html of the emails
$doc = new DOMDocument();
$doc->loadHTML($body);
$yourText=$doc->saveHTML();
$body=$yourText;
$body=htmlspecialchars($body);
$body=trim(preg_replace("/\r?\n/", " ",$body));
echo html_entity_decode($body);
can anybody help me in solving the above issue