3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = '練馬春日町Ⅳ 清掃レポート.pdf'; $first_word = mb_split('\p{Z}', $sentence); echo $first_word[0]; // Use preg_match() function to get the // first word of a string preg_match('/^\w+/iu', $sentence, $result); // Display result echo "\nThe first word of string is: ".$result[0];

preferences:
26.46 ms | 405 KiB | 5 Q