LoginSignup
0
0

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in の解決

Posted at

PHPで学習中

エラーメッセージ

Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in

    <p><?php echo htmlspecialchars($list['list']); ?></p>

修正後

    <p><?php echo htmlspecialchars($list['list'] ?? ''); ?></p>

nullだめ
?? → 値がない場合は??の右側を返す

とりあえずメモ
後日、書き直します。

参考サイト
https://habone.biz/7815

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