>  기사  >  백엔드 개발  >  PHP中的IF也可以这样用啊

PHP中的IF也可以这样用啊

WBOY
WBOY원래의
2016-06-23 14:12:40907검색

if(条件): do someting ;


不加:可以么 


回复讨论(解决方案)

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;


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

可以这样写
是这样
if(condition):...endif;

手滑了...

飞过~~~~


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

可以这样写
是这样
if(condition):...endif;
替代语法,手册中有提到的

嗯 替代语法

if(condition):
  dosomething;
endif;

while(conditon):
  dosomething;
endwhile;

...........

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.