Warning: Undefined array key 0 in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 406
Warning: Attempt to read property "parent" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 407
Warning: Attempt to read property "term_id" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413
Warning: Attempt to read property "cat_name" on null in /home/yatsuba/yatsuba.com/public_html/wp-content/themes/amaru/functions.php on line 413
スクリプト宣言
PHPはHTML文書内でスクリプト宣言を行って範囲内に命令を記述します。 スクリプト宣言は以下の四種類が用意されています。
| スクリプト宣言 | 備考 |
|---|---|
| <?PHP ~ ?> | 推奨 |
| <script language=”PHP”> ~ </script> | 長い、滅多に見ない |
| <? ~ ?> | 使用にはサーバ側で設定が必要 |
| <% ~ %> | 使用にはサーバ側で設定が必要 |
基本的にどの環境でも使用できる「<?PHP ~ ?>」で宣言すればいいです。 残りは「こういう宣言もあるんだな」程度に抑えておけばいいでしょう。
<title>Hello World!</title>
<?PHP echo '<p>Hello World!</p>' ?>
実行結果
ello World!



