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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 11:01:25 2019 UTC