php heredoc

http://www.cnblogs.com/mazey/p/6942762.html?utm_source=itdadao&utm_medium=referral

[root@web test.com]# cat 1.php

<?php
$username="siyu";
$mazey=<<<EOF
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <title>小黑记事本</title>
    <script>
        ! function(a, b) {
            var c = a.documentElement,
                d = "orientationchange" in window ? "orientationchange" : "resize",
                e = function() {
                    var a = c.clientWidth;
                    a && (a >= 750 && (a = 750), c.style.fontSize = 100 * (a / 750) + "px")
                };
            a.addEventListener && (b.addEventListener(d, e, !1), e())
        }(document, window);
    </script>
    <style type="text/css">
      .hei_main{
        width: 7.5rem;
        height: auto;
        margin:0 auto;
        font-size: 0.3rem;
      }
    </style>
</head>
<body>
<div class="hei_main">
hello world 你好,世界
</div>
{$username}
</body>
</html>
EOF;
echo $mazey;

    A+
发布日期:2017年08月11日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: