$名稱/中文or數字or日期or照片
// php語法沒有那麼嚴謹,可以指定為字串或數字,建議用 單引號
$name='Vanessa';
$age='18';
$now=date('Y-m-d',time());
$pic='<img src="images/pic01.jpg">';
php和html切割,完美配合
$html = <<<HEREDOC
<html>
內文是靜態網頁語法,再嵌入php呈現要的資料
</html>
HEREDOC;
html中呈現php變數值
// 以下html當作是一個文件, HEREDOC這名字也可以自己取,只要頭尾一樣即可。
$html = <<<HEREDOC
<html>
....這中間省略一些html語法
<p>日期:{$now}</p>
<p>姓名:{$name}</p>
<p>年齡:{$age}</p>
<p>照片:{$pic}</p>
....這中間省略一些html語法
</html>
HEREDOC;
//以下是把日期、姓名、年齡、照片全產出
echo $html;