PHP7 null合并运算符 告别isset() PHP7 null合并运算符 告别isset() 2015 年 12 月 4 日 北漂小兄弟 Comments 2 comments PHP7 null合并运算符 告别isset() 以前的写法 $info = isset($_GET[’email’]) ? $_GET[’email’] : ‘noemail’; 现在直接这样写就可以了 $info = $_GET[’email’] ?? noemail; 还可以这样连写使用 $info = $_GET[’email’] ?? $_POST[’email’] ?? ‘noemail’; 打赏赞(2)分享
2 thoughts on “PHP7 null合并运算符 告别isset()”
这网页能保持占用cpu超过60%
已优化