PHP conditional statements and ternary operators

巴扎黑
Release: 2023-03-03 12:10:01
Original
1655 people have browsed it

'; // 三元运算符不是一种必不可少的结构,但却是一种美化代码的途径。 // 同样,它可以取代不好的if…else代码块,并且可以提高代码的可读性。 //三元运算符 echo $str = $n3==$n4?'true':'false'; //输出 true true ?>
Copy after login

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!