Example #1
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$html = "<h1>Hello les copains</h1>";
echo transformHTML($html);
Example #2
0
{
    if (strpos($str, "<HTML") < 0 || strpos($str, "<html") < 0) {
        $makeHeader = "<html><head><meta http-equiv=\"Content-Type\"    content=\"text/html; charset=utf-8\"><style type=\"text/css\"> body { -webkit-text-size-adjust: none } </style></head>\n";
        if (strpos($str, "<BODY") < 0 || strpos($str, "<body") < 0) {
            $makeBody = "\n<body>\n";
            $str = $makeHeader . $makeBody . $str . "\n</body></html>";
        } else {
            $str = $makeHeader . $str . "\n</html>";
        }
    } else {
        $str = "<style type=\"text/css\"> body { -webkit-text-size-adjust: none } </style><meta http-equiv=\"Content-Type\" content=\"text/html;    charset=utf-8\">\n" . $str;
    }
    return $str;
}
if ($mailformat == "html") {
    $msgBody = utf8_encode(transformHTML($dataHtml));
} else {
    $msgBody = utf8_encode(strip_tags($msgBody));
    // $msgBody = htmlentities($msgBody);
    $smiley_wink = "<img src=\"smilies/emoticon_wink.png\" class=\"smiley\">";
    $smiley_smile = "<img src=\"smilies/emoticon_smile.png\" class=\"smiley\">";
    $smiley_tongue = "<img src=\"smilies/emoticon_tongue_out.png\" class=\"smiley\">";
    $smiley_cry = "<img src=\"smilies/emoticon_cry.png\" class=\"smiley\">";
    $smiley_frown = "<img src=\"smilies/emoticon_frown.png\" class=\"smiley\">";
    $smiley_cool = "<img src=\"smilies/emoticon_cool.png\" class=\"smiley\">";
    if ($transformsmilies == "true") {
        $msgBody = str_replace(";)", $smiley_wink, $msgBody);
        $msgBody = str_replace(";-)", $smiley_wink, $msgBody);
        $msgBody = str_replace(":)", $smiley_smile, $msgBody);
        $msgBody = str_replace(":-)", $smiley_smile, $msgBody);
        $msgBody = str_replace(":-P", $smiley_tongue, $msgBody);