echo <<<js
<script type= "Text/javascript" >
alert (' delete success ');
Window.location.href = "Index.php?app=homepage&act=module_list";
</script>
JS;
Format above
1. Tags cannot appear on the same line as content
2, the end tag must be immediately at the beginning of the line
3, mark the left and right sides can not appear space
Because the use of not much, when to forget, so record down to check
Heredoc technology, in regular PHP documents and technical books are not generally described in detail, but mentioned that this is a Perl-style string output technology. But now some of the Forum program, and some of the article system, are clever use of heredoc technology, to part of the implementation of the interface and code of the quasi-separation, phpwind template is a typical example. As follows:
<?php
Header ("Content-type:text/html;charset=utf-8");
$name = ' Shallow Water tour ';
Print <<<eot
1. Start with <<<end start tag, end With end tag, end tag must be write, no indents and spaces, and semicolon at end of tag. The start tag is the same as the start tag, such as the commonly used uppercase EoT, EOD, EOF, but not just those, as long as the start and end tags do not appear in the body.
2. Variables located between the opening and closing tags can be parsed normally, but the function may not. In Heredoc, a variable does not require a connector. Or, to splice, as follows:
<?php
$v =2;
$a = <<<eof
"abc" $v
"123"
EOF;
echo $a; The result is output along with double quotes: "ABC" 2 "123"
3.heredoc is often used when output contains a large number of HTML syntax D documents. For example: function outputhtml () to output the HTML homepage. There are two ways to do this. It is obvious that the second formulation is simpler and easier to read.
<?php
function outputhtml () {
echo "