4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ずんだの縦読み問題 php編

Last updated at Posted at 2018-09-27

てぃーびーさんのずんだの縦読み問題
をPHPで実装しました。
(結構愚直な実装です。)

PHP


$tweet = "
忙しくてついったいじれない
さみしい
つらい
";

$tweetExplode = explode("\n", $tweet); 
$tweetTrimmed = array_map('trim', $tweetExplode);

foreach($tweetTrimmed as $val){
    echo mb_substr($val, 0, 1, 'utf8');
}
# => 忙さつ
4
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?