|
-
Apr 27th, 2001, 04:19 AM
#1
Thread Starter
Lively Member
common error... i do it all the time. There are different comparators for strings and numberical data. "==" is numerical and you want to compare strings so you should use eq.
ie..
$tmpstr=substr($temp_file,-4,4);
if ($tmpstr eq ".htm")
{
print "True: $temp_file ($tmpstr)<BR>\n";
}
the other operators like this are
Numerical - String - Use
== - eq - is equal to
<> - ne - is not equal to
> - ge - is greater than
< - le - is less than
that is the basic ones there are others like ++ and -- but you wouldnt need to use them now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|