php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8034 string function (strcspn)
Submitted: 2000-11-29 11:03 UTC Modified: 2000-12-07 05:49 UTC
From: rottmann at inveris dot de Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0.3pl1 OS: linux (suse)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rottmann at inveris dot de
New email:
PHP Version: OS:

 

 [2000-11-29 11:03 UTC] rottmann at inveris dot de
why is "string function" not in the Type of bug: list??

<?
$stringvalue = "xy.,.-,z1";

echo strspn (strtolower ($stringvalue), "abcdefghijklmnopqrstuvwxyz0123456789") . "<br>"; // right
echo strcspn (strtolower ($stringvalue), "abcdefghijklmnopqrstuvwxyz0123456789") . "<br>"; // wrong
?>

the strspn returns the right value...
but strcpsn returns only the right value when the first digit is not in the 2nd string?!?!? or i did misunderstand the
function???

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-07 05:49 UTC] stas@php.net
For me strcspn returns 0, which is the correct result, since
strcspn is meant to return length of the segment that does
not contain any of the characters in the second arg. Since
"x" (the first character) is already there, the length is 0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC