PHP 4.0 Bug #3969: Strpos won't return the 1st instance of string
| From: | iliaa at home dot com | Date: | Wed, 29 Mar 2000 23:24:39 +0000 |
| Subject: | PHP 4.0 Bug #3969: Strpos won't return the 1st instance of string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17366@lists.php.net to get a copy of this message | ||
From: iliaa@home.com
Operating system: Linux 2.2.14
PHP version: 4.0 Release Candidate 1
PHP Bug Type: Misbehaving function
Bug description: Strpos won't return the 1st instance of string
// Sample Code
$position = strpos("http://www.php.net",
".");
echo substr("http://www.php.net", 0, $position);
// Result
http://www.php
The problem is that according to the docs strpos is supposed to return the position of the 1st
occurance of the character in the string (strpos -- Find position of first occurrence of a string).