<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta name='Generator' content='Microsoft Word 14 (filtered medium)'>
<style><!--
/* Font Definitions */
@font-face
{ font-family:'Cambria Math';
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{ font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{ font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:'Times New Roman','serif';}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:'Times New Roman','serif';}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:'Calibri','sans-serif';
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
-->
</style>
</head>
</html>
This the html content I get when i read the mail through imap function I want to remove the style tag and the content inside the style tag and then print/echo it in php. I have i have used preg_match but it does not work
preg_replace("/<style\\b[^>]*>(.*?)<\\/style>/s", "", $subject[$i])
The $subject[$i] is the content in which I have the above html code