Source for file modifier.count.php

Documentation is available at modifier.count.php

  1. <?php
  2. /**
  3.  *  smarty modifier:count()
  4.  *
  5.  *  count()関数のwrapper
  6.  *
  7.  *  sample:
  8.  *  <code>
  9.  *  $smarty->assign("array", array(1, 2, 3));
  10.  *
  11.  *  {$array|@count}
  12.  *  </code>
  13.  *  <code>
  14.  *  3
  15.  *  </code>
  16.  *
  17.  *  @param  array   $array  対象となる配列
  18.  *  @return int     配列の要素数
  19.  */
  20. function smarty_modifier_count($array)
  21. {
  22.     return count($array);
  23. }

Documentation generated on Fri, 11 Nov 2011 04:01:16 +0900 by phpDocumentor 1.4.3