#32885 [Opn->Bgs]: Miscalulcating string length
| From: | derick@php.net | Date: | Fri, 29 Apr 2005 06:46:01 +0000 |
| Subject: | #32885 [Opn->Bgs]: Miscalulcating string length | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78420@lists.php.net to get a copy of this message | ||
ID: 32885
Updated by: derick@php.net
Reported By: homework at aofrozencity dot com
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: Windows 2003 Server
PHP Version: 4.3.9
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
.
Previous Comments:
------------------------------------------------------------------------
[2005-04-29 08:35:44] homework at aofrozencity dot com
Description:
------------
'pictures' should be 8 string length. Thought, I got the result. It
said that 'pictures' is 13 string length. It isn't correct. I notice
that I use different words. It shows that string length is added with 5
practically. You can see that 8 (pcitures) length + 5 add length = 13
string length. I don't know why it is.
Reproduce code:
---------------
function word_match($a=null,$b=null)
{
print("Orginal A: $a<br>");
$a_length = strlen($a);
$b_length = strlen($b);
$search = true;
$length = 0;
while($search)
{
if(substr($b,$length,$a_length)==$a)
{
$search = false;
$result = true;
}elseif($length>$b_length){
print("<b>Websatellite: A: $a B: $b
($length>$b_length)</b>");
$result = false;
$search = false;
}
print("<b><br>Websatellite: ($a_length)
".substr($b,$length,$a_length)."==$a</b>");
$length++;
}
return $result;
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32885&edit=1