当前位置: 代码迷 >> PHP >> PHP中的IF也可以这么用
  详细解决方案

PHP中的IF也可以这么用

热度:8   发布时间:2016-04-28 21:16:57.0
PHP中的IF也可以这样用啊
if(条件): do someting ;


不加:可以么 

------解决方案--------------------
http://www.php.net/manual/en/control-structures.alternative-syntax.php
------解决方案--------------------

if(condition):
....
end if;

可以这样写
------解决方案--------------------
引用:

if(condition):
....
end if;

可以这样写

是这样

if(condition):
...
endif;

------解决方案--------------------
引用:
Quote: 引用:


if(condition):
....
end if;

可以这样写

是这样

if(condition):
...
endif;
替代语法,手册中有提到的
------解决方案--------------------
嗯 替代语法

if(condition):
  dosomething;
endif;

while(conditon):
  dosomething;
endwhile;

...........
  相关解决方案