note 118893 added to function.preg-match

From: Date: Wed, 24 Feb 2016 09:45:17 +0000
Subject: note 118893 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-205025@lists.php.net to get a copy of this message
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)); ?> ---- Server IP: 72.52.91.14 Probable Submitter: 91.137.62.108 ---- Manual Page -- http://php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/118893 Del: integrated -- https://master.php.net/note/delete/118893/integrated Del: useless -- https://master.php.net/note/delete/118893/useless Del: bad code -- https://master.php.net/note/delete/118893/bad+code Del: spam -- https://master.php.net/note/delete/118893/spam Del: non-english -- https://master.php.net/note/delete/118893/non-english Del: in docs -- https://master.php.net/note/delete/118893/in+docs Del: other reasons-- https://master.php.net/note/delete/118893 Reject -- https://master.php.net/note/reject/118893 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205025) next »