PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<开始/结束标记while 语法>
Last updated: Mon, 16 Jul 2012

if..endif 语法

使用 if(); elseif(); else; endif; 这一系列复杂的语句无助于 PHP 3.0 解析器的效率。因此,语法改变为:

例子 D-5. 移植:旧有 if..endif 语法

if ($foo);
   echo "yep\n";
elseif ($bar);
   echo "almost\n";
else;
   echo "nope\n";
endif;

例子 D-6. 移植:新的 if..endif 语法

if ($foo):
   echo "yep\n";
elseif ($bar):
   echo "almost\n";
else:
   echo "nope\n";
endif;
注意,在所有的声明中分号均改为冒号,除了末尾的 endif 以外。




<开始/结束标记while 语法>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST