直接用PHP输出HTML代码的方式

【转自】:http://blog.csdn.net/jxyuhua/archive/2004/08/30/88581.aspx

1
2
3
4
5
6
7
8
9
10
11
12
<?php
 
$str = <<<  HTML
 
fsdfsdfsd
<>Dfsdf<SDFSDF?$#%$@#$
 
HTML;
 
echo $str;
 
 ?>

其中HTML这个名字可以随便取比如ABC,但是要一致(区分大小写),最后结束要顶格,也就是要在一行的最开头。也可以直接echo:

1
2
3
4
5
6
7
8
9
<?php
 
echo <<< aBc
 
<html><html>
 
aBc;
 
?>

No related content found.

No Comments.

Leave a Reply

(required)

(required)

:alien: :angel: :angry: :blink: :blush: :cheerful: :cool: :cwy: :devil: :dizzy: :ermm: :face: :getlost: :biggrin: :happy: :heart: :kissing: :lol: :ninja: :pinch: :pouty: :sad: :shocked: :sick: :sideways: :silly: :sleeping: :smile: :tongue: :unsure: :w00t: :wassat: :whistle: :wink: :wub: