日期:2014-05-17  浏览次数:20731 次

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;

...........