Often you can avoid large if/else statements in your code by using the
ternary operator. For example:
<?php
echo "You have $i
". ($i==1 ? "message" : "messages"). " in
your mailbox.\n";
?>
| PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册 |
|
| |||||||||||||||
| view source | feedback | send page | sitemap | aboutus |
|
Copyright ® 2002-2003 PHPE.NET. All rights reserved Last updated:2002-11-22 |