php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1234 STRPOS substring not found / found on Position 0
Submitted: 1999-03-14 13:33 UTC Modified: 2003-02-19 17:55 UTC
From: tom dot weber at web dot lu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
16 + 14 = ?
Subscribe to this entry?

 
 [1999-03-14 13:33 UTC] tom dot weber at web dot lu
If You use the STRPOS and you don't find anything it will return FALSE
FALSE has the Value 0.
Now, If You are looking for a sub-string and it is located on the beginning
of the String, it will return 0.

You are not able anymore to distringuish if it is in the string at pos 0
or not.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-14 14:26 UTC] rasmus
FALSE is defined as the empty string "" which strpos() will return when a match is not found.  If a match is found in the first position it will return 0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 20:01:31 2024 UTC