3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$utf8string = '测试杂志hello123等々'; $utf8string = '测试杂志'; //$utf8string = mb_substr('测试杂志', 0, 2, 'UTF-8'); $utf8string = mb_substr('Hello How are you志', 0, 2, 'UTF-8'); echo $utf8string; //$var = 'hello123'; //$pos = strpos($utf8string, $var); //if ($pos!==false) { //echo substr($utf8string, 0, 10); //}

preferences:
43.94 ms | 402 KiB | 5 Q