输入banner图图片脚本导航/分类

PHP中的IF也可以这么用

PHP中的IF也可以这样用啊
if(条件): do someting ;


不加:可以么

分享到:


------解决方案--------------------
http://www.php.com/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;

...........