« ffmpeg 最近ので libx264 にてエラー 解決 | メイン | PHP 改行コードの統一 »
2010年03月16日
一文字ごとに分割
explodeやらで出来たような記憶もあるんだが・・・忘れた;
str_split($str);
でとりあえずできます(半角文字のみ)。すぐ忘れるのでメモ
mb_str_split($str);
は なさげなので、日本語の場合は・・・・
$textlen = mb_strlen($line,"utf-8");
for ( $i = 0; $i < $textlen; $i++ ) {
$line_arr[] = mb_substr( $line, $i, 1,"utf-8");
}
てなかんじでやってみた
投稿者 muuming : 2010年03月16日 13:19