以前总是要使用的isset方法 现在可以简化了
曾经是这样的:
$info = isset($_GET['something']) ? $_GET['something'] : 'nothing';
现在可以这样了:
$info = $_GET['something'] ?? 'nothing';
甚至你还可以这样:
$info = $_GET['something'] ?? $_POST['something'] ?? 'nothing';
以前总是要使用的isset方法 现在可以简化了
曾经是这样的:
$info = isset($_GET['something']) ? $_GET['something'] : 'nothing';
现在可以这样了:
$info = $_GET['something'] ?? 'nothing';
甚至你还可以这样:
$info = $_GET['something'] ?? $_POST['something'] ?? 'nothing';