"alert(123);"; $js .= "</script>"; // DBアクセス $sql = "select * from hoge_table"; $result = $db->exec($sql); // 何かのロジック $hoge = commonFunction(); // 突然のprintでHTML出力 if ($hoge === "hoge") { print "<div>"; print "hogehoge"; print "</div>"; } else if ($hoge === "fuga") { print "<div>"; print "fugafuga"; print "</div>"; } else { print "<div>"; print "piyooo"; print "</div>"; } ~~~ // 突然のprintでHTML出力 if ($hoge === "hoge") { if ($isNewUI) { print "<div>"; print "new ui is cool."; print "</div>"; } else { print "<div>"; print "hogehoge"; print "</div>"; } } else if ($hoge === "fuga") { print "<div>"; print "fugafuga"; print "</div>"; } else { if ($isNewUI) { print "new ui is cool."; } print "<div>"; print "piyooo"; print "</div>"; }