Source for file modifier.explode.php

Documentation is available at modifier.explode.php

  1. <?php
  2. /**
  3.  *  smarty modifier:explode()
  4.  *
  5.  *  join()関数のwrapper
  6.  *
  7.  *  sample:
  8.  *  <code>
  9.  *  $smarty->assign("string", "1,2,3");
  10.  *
  11.  *  {$array|explode:","}
  12.  *  </code>
  13.  *  <code>
  14.  *  array(1, 2, 3)
  15.  *  </code>
  16.  *
  17.  *  @param  string  $string  explode対象の文字列
  18.  *  @param  string  $glue   分割文字列
  19.  *  @return array   分割後の配列
  20.  */
  21. function smarty_modifier_explode($string$glue)
  22. {
  23.     if ($glue == ""{
  24.         return false;
  25.     }
  26.  
  27.     return explode($glue$string);
  28. }

Documentation generated on Fri, 11 Nov 2011 03:58:44 +0900 by phpDocumentor 1.4.3