PHP 8.4.24 Released!

Voting

: two minus two?
(Example: nine)

The Note You're Voting On

Jonny 5
14 years ago
Workaround for getting the offset in UTF-8
(in some cases mb_strpos might be an option as well)

<?php
if(preg_match($pattern,$haystack,$out,PREG_OFFSET_CAPTURE)) {
    $offset = strlen(utf8_decode(substr($haystack,0,$out[0][1])));
}
?>

<< Back to user notes page

To Top