Blogger Information
Blog 36
fans 4
comment 3
visits 31906
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
7.22 三元运算和if else
大灰狼的博客
Original
851 people have browsed it

//php 5 的三目运算符

$name = isset($_GET['name']) ? $_GET['name'] : '' ;

// 等价的 PHP 7 新写法

$name = $_GET['name'] ?? '';


//php 5 的三目运算

<?php echo isset($_POST['email']) ? $_POST['email'] : '' ; ?>

//等价的 php7 三目运算

<?= $_POST['email'] ?? '' ; ?>

有空了 我再来更新~

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post