|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-07-25 00:34 UTC] steve at teamits dot com
If I use the following line on a UNIX server (running PHP 3.0.9), the test works as intended...meaning if "</body" is the first entry on the line, the test returns true. I am 99.9% sure I have the exact same line on my test machine running PWS 4.0 (I can't check from here).
if (strpos(strtolower($line), '</body') == "0") {
However, on IIS 4.0, if $line is a value that does not start with "</body", the test still returns true...I'm assuming this is because strpos() returns "" (false, which it does) and the parser compares that to "0" and assumes "0" is false, therefore the test "if (false=false)" returns a true value. I can get around this by changing the test to
if (strpos(strtolower('a'.$line), '</body') > 1) {
...but it seems to me that the function/parser should work the same under PWS and IIS and UNIX. I was just confused why my page worked on the UNIX server and wouldn't work under IIS. BTW, I have tried both the CGI and ISAPI versions, and both behave the same way.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 16:00:01 2025 UTC |
The CGI on both win32 and Unix returns the same for me using this test. Instead of this workaround you have invented, why not use: if (strpos(strtolower($line), '</body') !== FALSE) { (Which I'd venture a guess is already being used, in one form or another, on the Unix box) Double check and make sure that the Unix and the NT box really are using the same code, and one is not using === ( or a variant thereof )