note 47874 added to function.preg-match

From: Date: Fri, 03 Dec 2004 16:34:28 +0000
Subject: note 47874 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-81324@lists.php.net to get a copy of this message
This helped me to make a mask for all french characters. Just modify the $str in ordre to find your mask. <pre> <?php $str = "àÀâÂéÉèÈëËêÊîÎïÏôÔçÇ"; $strlen = strlen($str); $array = array(); $mask = "/^[a-zA-Z"; for ($i = 0; $i < $strlen; $i++) { $char = $str{$i}; $hexa = dechex(ord($char)); echo htmlentities($char)." = ". $hexa . "\n"; $array[$i] = $hexa; $mask .= '\\x' . $hexa; } $mask .= " ]+$/"; echo $mask; ?> </pre> ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47874 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47874&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47874&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81324) next »