|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-07 12:17 UTC] roger4a45 at yahoo dot es
whe we use strlen or substr there is a bug if parameter string is something like this: $a = "<HTML><HEAD><TITLE>something</TITLE></HEAD><BODY>hi!</BODY><HTML>"; $b = strlen($a); echo $b; output is 0 rather real length of string.... Substr don't work right if we use same $a... any idea? Is use a PHP 4.2.3 (ZIP file) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
A bug is when a function don't work properly... so, if I make strlen("<HTML>") i wait that output will be 6. if strlen produce another result is a bug. Ok. I will try to comment it to support forum. Thanks.I think my problem is when I use strlen inside a class with HTML TAGS delimiters ('<' and '>'). Behavior of strlen is bad. if $a = "<HTML>" it says that strlen($a) is 0 rather than 6. I used substr to change '<' and '>' for '?' and '&' and then use strlen. but of course is dirty-dirty.