LoginSignup
1
5

More than 5 years have passed since last update.

PHP NULL合体演算子

Posted at

PHP7からNULL合体演算子が追加されたので書き方メモ

//$_GET['user']が存在すれば$usernameに代入。nullならnobodyを代入
$username = $_GET['user'] ?? 'nobody';
1
5
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
1
5