0
0

More than 3 years have passed since last update.

PHP基礎④

Last updated at Posted at 2020-08-20

 echoの省略

PHP
<?php echo ?>
↓ ↓ ↓
<?= ?>
# 省略できる!

 ランダムなメッセージの表示

PHP
mt_rand(1,3);
# 1以上、3以下のランダムな整数値を作成

 悪意にあるコードを防げる

PHP
<?= htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); ?>

「htmlspecialchars」に(変数,ENT_QUOTES,文字コード)
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