public function lettering($str)
  {
    $output = '';
    $array = str_split($str);
    $idx = 1;

    foreach ($array as $letter) {
      $output .= '<span class="char' . $idx++ . '">' . $letter . '</span>';
    }

    return $output;
  }
public function lettering($str)
  {
    $output = '';
    $array = str_split($str);
    $idx = 1;

    foreach ($array as $letter) {
      $output .= '<span class="char' . $idx++ . '">' . $letter . '</span>';
    }

    return $output;
  }
public function lettering ( $ str ) { $ output = '' ; $ array = str_split ( $ str ) ; $ idx = 1 ; foreach ( $ array as $ letter ) { $ output .= '<span class="char' . $ idx ++ . '">' . $ letter . '</span>' ; } return $ output ; }
a port of "Lettering.js" in php

@param $str

@return string
a port of Lettering . js in php