PHP流程控制替代语法举例
If:
<?php if ($a == 1): ?>
<div>
...
</div>
<?php elseif ($a == 2): ?>
<div>
...
</div>
<?php else: ?>
<div>
...
</div>
<?php endif; ?>
While:
<?php while (expr): ?>
<div>
...
</div>
<?php endwhile; ?>
If:
<?php if ($a == 1): ?>
<div>
...
</div>
<?php elseif ($a == 2): ?>
<div>
...
</div>
<?php else: ?>
<div>
...
</div>
<?php endif; ?>
While:
<?php while (expr): ?>
<div>
...
</div>
<?php endwhile; ?>