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?

More than 3 years have passed since last update.

PHPで気をつけること

Last updated at Posted at 2020-07-13

コードの可読性

if文の順番

foreach ($array as $key => $val) {
  if (!empty($val)) {
    // ここに処理を書く
  } else {
    continue;
  }
}

車輪の再開発❌

  • 既存の関数を用いる

コードを書く前に 描く!

  • フローチャートを書いてからコーディングする方が開発工数が短い!

コメントは、コードに書けないことを書く

1万時間の訓練

  • 週20時間(毎日約3時間)なら、10年で到達
  • 週35時間(毎日 5時間)なら、6年弱で到達
  • 週49時間(毎日 7時間)なら、4.3年で到達

セキュリティ的に注意するコード (ユーザ引数を渡さない)

  • eval
    • PHPのコードとして実行
  • exec
    • 外部プログラムを実行
  • file
    • ファイルの中身を配列に格納
  • file_get_contents
    • ファイルを文字列として格納
  • fopen
    • 指定ファイル/URLを開く

参考

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?