3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text ='12345 12345 12345 4'; $cut_text=trim(mb_substr($text,0,mb_strrpos(mb_substr($text,0,5,'utf-8'),' ',utf-8),'utf-8'), '\,'); echo $cut_text;
Output for 7.1.0
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3 Warning: A non-numeric value encountered in /in/dlfHK on line 3 Warning: mb_strrpos(): Offset is greater than the length of haystack string in /in/dlfHK on line 3
Output for 5.2.9 - 7.0.14
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3 Warning: mb_strrpos(): Offset is greater than the length of haystack string in /in/dlfHK on line 3
Output for 5.2.6 - 5.2.8
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3 Notice: mb_strrpos(): Offset is greater than the length of haystack string in /in/dlfHK on line 3
Output for 5.2.0 - 5.2.5
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3
Output for 4.3.2 - 5.1.6
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3 Warning: mb_strrpos(): Unknown encoding "-8" in /in/dlfHK on line 3
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant utf - assumed 'utf' in /in/dlfHK on line 3 Warning: mb_strrpos() [http://www.php.net/function.mb-strrpos]: Unknown encoding "-8" in /in/dlfHK on line 3