CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: max(five, zero)?
(Example: nine)

The Note You're Voting On

Jonny 5
13 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