note 118893 deleted from function.preg-match by cmb
| From: | cmb@php.net | Date: | Sun, 28 Oct 2018 10:44:00 +0000 |
| Subject: | note 118893 deleted from function.preg-match by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209538@lists.php.net to get a copy of this message | ||
Note Submitter: Julius
----
Regarding utf-8 and offset:
Be aware that the 5th Parameter behaves in the same way as the 4th is handeled. The $offset
parameter should therefore be given as byte length.
<?php
var_dump(preg_match('/#/u', 'a#',$matches,0,2));
var_dump(preg_match('/#/u', "\xc3\xa4#",$matches,0,2));
var_dump(preg_match('/#/u', "\xc3\xa4#",$matches,0,3));
?>