search
LoginSignup
0

More than 3 years have passed since last update.

posted at

updated at

ずんだの縦読み問題 php編

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

PHP


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

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

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

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
What you can do with signing up
0