3v4l.org

run code in 300+ PHP versions simultaneously
<?php $utf8string = 'こんにちは、漢字ユーティーエッフ8hello123等々'; $var = 'hello123'; $pos = strpos($utf8string, $var); if ($pos!==false) { echo substr($utf8string, 0, $pos); }

preferences:
36.15 ms | 402 KiB | 5 Q