example.ephp 348 B

1234567891011121314151617
  1. <?php
  2. $user = "World";
  3. $list = array('<aaa>', 'b&b', '"ccc"');
  4. ?>
  5. <p>Hello @{$user}@!</p>
  6. <table>
  7. <tbody>
  8. <?php $i = 0 ?>
  9. <?php foreach ($list as $item) { ?>
  10. <?php $i++; ?>
  11. <tr bgcolor="@!{$i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'}@">
  12. <td>@!{$i}@</td>
  13. <td>@{$item}@</td>
  14. </tr>
  15. <?php } ?>
  16. </tbody>
  17. </table>