note 86942 added to function.preg-replace

From: Date: Tue, 11 Nov 2008 16:13:51 +0000
Subject: note 86942 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-146387@lists.php.net to get a copy of this message
Perhaps obvious, but apparently not noted: the 'g' modifier on your regexp (i.e. '/[^0-9]/g') is unnecessary, and in fact, unsupported. preg_replace() assumes a global match-and-replace, and if you try to reinforce that with 'g', it will complain. ---- Server IP: 64.71.164.2 Probable Submitter: 72.55.202.68 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- https://master.php.net/note/edit/86942 Del: integrated -- https://master.php.net/note/delete/86942/integrated Del: useless -- https://master.php.net/note/delete/86942/useless Del: bad code -- https://master.php.net/note/delete/86942/bad+code Del: spam -- https://master.php.net/note/delete/86942/spam Del: non-english -- https://master.php.net/note/delete/86942/non-english Del: in docs -- https://master.php.net/note/delete/86942/in+docs Del: other reasons-- https://master.php.net/note/delete/86942 Reject -- https://master.php.net/note/reject/86942 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146387) next »