home | create | search | help
  1. function utf8_substr($str,$start)
  2. {
  3.    preg_match_all(\"/./u\", $str, $ar);
  4.  
  5.    if(func_num_args() >= 3) {
  6.        $end = func_get_arg(2);
  7.        return join(\"\",array_slice($ar[0],$start,$end));
  8.    } else {
  9.        return join(\"\",array_slice($ar[0],$start));
  10.    }
  11. }
  12.  
Subscribe to this code! Get Firefox! Valid XHTML Valid CSS Powered By GeSHi 666 pieces of code saved