I am trying to get the HTML template from the GMAIL original email view, the problem is that gmail adds an =
character to the end of each line.
I used a foreach
loop to iterate through the lines and remove the "=" character, but it is still not working at all.
I also have an if
statement to validate the existence of the character.
Example GMAIL original view lines:
body[dir=3Drtl] .directional_text_wrapper { direction: rtl; unicode-bid=
i: embed; }
</style>
</head>
<body lang=3D"en-us" style=3D"width:100%!important;margin:0;padding:0">
<div style=3D"padding:10px;line-height:18px;font-family:'Lucida Grand=
e',Verdana,Arial,sans-serif;font-size:12px;color:#444444">
Code:
<?php
$original_email=file("original.html");
foreach ($original_email as $line)
{
$sbstr=substr($line,-2,1);
if( $sbstr == "="){
echo $substr;
}
}
?>
UPDATE
I have tried using the rtrim()
function with no luck.
The updated code:
<?php
$original_email=file("original.html");
foreach ($original_email as $line)
{
/*
$sbstr=substr($line,-2,1);
if( $sbstr == "="){
echo $substr;
}
*/
rtrim($line,"=");
}
?>