0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PHP学習メモ②

Posted at

PHPの基本

①文字列を指定:前後に ' '、" "

②ファイル末尾の閉じタブ ?> は省略すべき
└入力すると、もし空白があると出力画面のレイアウトが微妙にズレたりする

③PHPでは単純な値を出力できる

<?php~?>  の代わりに  <?=~?>

④文の区切りはセミコロン(;)

└文の終わりではなく、文と文の区切りを表す
⑤ブレークポイントいう行単位のみ使用可能な機能を使うために、複数の分を1行にまとめないが原則

よくない例
print' NO ! <br />' ; print' YES ! ';

⑥PHPでは、命令の大文字/小文字を区別しない
└コードを読み返すときに、記述が読みにくいことは避けたい

結果は同じ
PRINT' NO ! <br />';
pRinT' YES !';

⑦開発者のためのコメントは3種類ある
1.<!--~-->
└ブラウザ上にだけ表示されないが、PHPのコードは実行される
2. // 、#
3. /* ~ */

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?