php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15097 mbstring_substr_count
Submitted: 2002-01-18 06:50 UTC Modified: 2002-11-09 11:31 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: webmaster at devchina dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.1 OS: win2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at devchina dot com
New email:
PHP Version: OS:

 

 [2002-01-18 06:50 UTC] webmaster at devchina dot com
View my code:
   $str1="D?D?D";
   $str2="D";
   print substr_count($str1,$str2); 
return 3,right result is 1
the string "?D" in Gb2312,is Chinese.
Used english is right,I don't konw where the problem in it. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-22 08:07 UTC] martin at humany dot com
This is not a bug. substr_count($haystack, $needle)

when haystack is "D?D?D" and needle is "D", it returns 3 of course, since D is found 3 times in haystack
 [2002-07-07 13:05 UTC] derick@php.net
Refiling as feature request for the mbstring extension, where this kind of stull should be implemented (as mb_substr_count()).

Derick
 [2002-11-09 11:31 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 07:01:30 2024 UTC