-
- $a = "joe";
- $b = "jerry";
- if ($a != $b)
- {
- echo "not equal";
- }
- else
- {
- echo "Equal";
- }
- ?>
-
Copy code
If you use !==, === to compare, the types of the two objects must be strictly equal to return true; otherwise, use ==, != will automatically convert the string into the corresponding type for comparison.
-
- echo strnatcmp("10.gif", "5.gif"); // Return 1 (>0)
- echo strnatcasecmp("10.gif", "5.gif "); // Return 1 (>0)
- ?>
Copy code
|