#20721 [Opn]: mb_split not splitting ...
| From: | moriyoshi@php.net | Date: | Fri, 29 Nov 2002 17:56:53 +0000 |
| Subject: | #20721 [Opn]: mb_split not splitting ... | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26197@lists.php.net to get a copy of this message | ||
ID: 20721
Updated by: moriyoshi@php.net
Reported By: jc@mega-bucks.co.jp
Status: Open
Bug Type: mbstring related
Operating System: Red Hat Linux 7.2
PHP Version: 4.2.2
New Comment:
This is not a bug. mb_split() distinguishes full-width and half-width
characters. So you should simply parenthesise both characters as a
regex character class like
list($a, $b) = mb_split("[@¡÷]", $EMAIL);
Previous Comments:
------------------------------------------------------------------------
[2002-11-29 06:20:17] jc@mega-bucks.co.jp
The following code using mb_split() is not working as expected:
$EMAIL = $_POST["email"];
echo "ecoding was ".mb_detect_encoding($EMAIL)."<BR>";
list($a, $b) = mb_split("@", $EMAIL);
echo "a is $a <BR>";
echo "b is $b <BR>";
OUTPUT:
£ê£ã¡÷Test.Com
ecoding was EUC-JP
Notice: Undefined offset: 1 in update_email_pw.php on line 38
a is £ê£ã¡÷Test.Com
b is
My internal encodingis set to EUC_JP so I would think that even though
I used the ASCII "@" it should work for splitting.
Jc
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20721&edit=1