開始タグと終了<?php /* stuff */ ?>
タグがあり、その後に標準の HTML がある PHP スクリプトがある場合、たとえば、スクリプトがエラーをキャッチした場合に、サーバーに通常の HTML の送信を停止するように指示することは可能ですか?
例...
<?php
// ... rest of the script above here
$buildout = '(compiler output will display here)';
$execsout = '(program output will display here)';
// ... errors would be displayed here using die();
?>
<!doctype html>
<head>
<title>Test Page</title>
<meta charset="utf-8"/>
<!-- rest of the HTML below here -->
必要なことは、スクリプトがまだ PHP 部分を処理している間に die() し、HTML を送信しないことです。その理由は、PHP 自体を使用してエコー/印刷するには HTML が多すぎて、編集がはるかに面倒になるからです。