note 72510 added to function.preg-replace

From: Date: Mon, 22 Jan 2007 10:54:03 +0000
Subject: note 72510 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-122034@lists.php.net to get a copy of this message
Bug with /\s/ and à The command preg_replace('/\s+/', " ", $str); cuts the string off when an french à occurs in utf8 strings. Workaround: $str = preg_replace('/à/', "#agrave#", $str); $str = preg_replace('/\s+/', $whitespace, $str); $str = preg_replace('/#agrave#/', "à", $str); ---- Server IP: 212.124.37.9 Probable Submitter: 62.153.89.43 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- https://master.php.net/note/edit/72510 Del: integrated -- https://master.php.net/note/delete/72510/integrated Del: useless -- https://master.php.net/note/delete/72510/useless Del: bad code -- https://master.php.net/note/delete/72510/bad+code Del: spam -- https://master.php.net/note/delete/72510/spam Del: non-english -- https://master.php.net/note/delete/72510/non-english Del: in docs -- https://master.php.net/note/delete/72510/in+docs Del: other reasons-- https://master.php.net/note/delete/72510 Reject -- https://master.php.net/note/reject/72510 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122034) next »