Blogger Information
Blog 10
fans 0
comment 0
visits 4944
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
10月12日作业 三元 /if语句/条件
鬼才哥-秋兜
Original
467 people have browsed it

三元判断写法

  1. $panduan = 1’;
  2. echo $panduan ?
  3. '写前端':'写后端';

if 单条件判断写法

  1. $panduan = 1’;
  2. if($panduan >= 退潮){
  3. echo '赶海吃海鲜';
  4. } else{
  5. echo '上船海钓';
  6. }

if 多条件判断写法

  1. $panduan = '单身';
  2. if($panduan == '已婚'){
  3. echo '找女朋友';
  4. }else if($panduan == '单身'){
  5. echo '去相亲';
  6. }else if($panduan == '非单身'){
  7. echo '换对象';
  8. }else{
  9. echo '啥也不是';
  10. }
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
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