"<<<" 稱為 here doc syntax,PHP 4/5 才有提供這個語法,用來定義「一堆」字串給變數時特別好用,例如:
<?php $str = <<<EOD I saw a dog yesterday. It's very fat. Too fat to walk. I tried to help it. But in vain. Because it weights 100 KG. EOD; ?>
$str 字串的值即為:
I saw a dog yesterday. It's very fat. Too fat to walk. I tried to help it. But in vain. Because it weights 100 KG.
EOD 為字串的開始與結果,可自定,要注意的是,<<
--jollen