split.php
<?php
$text = "テキストtextテxト";
$encoding = "UTF-8";
$textLength = mb_strlen($text, $encoding);
for($i = 0; $i < $textLength; $i++) {
echo mb_substr($text, $i, 1, $encoding)."\n";
}
More than 5 years have passed since last update.
<?php
$text = "テキストtextテxト";
$encoding = "UTF-8";
$textLength = mb_strlen($text, $encoding);
for($i = 0; $i < $textLength; $i++) {
echo mb_substr($text, $i, 1, $encoding)."\n";
}
Register as a new user and use Qiita more conveniently