PHP strcasecmp() Function
Complete PHP String Reference
Definition and Usage
The strcasecmp() function compares two strings.
This function returns:
- 0 - if the two strings are equal
- <0 - if string1 is less than string2
- >0 - if string1 is greater than string2
Syntax
|
strcasecmp(string1,string2)
|
| Parameter |
Description |
| string1 |
Required. Specifies the first string to compare |
| string2 |
Required. Specifies the second string to compare |
Tips and Notes
Tip: The strcasecmp() function is binary safe and case-insensitive.
Example
<?php
echo strcasecmp("Hello world!","HELLO WORLD!");
?>
|
The output of the code above will be:
Complete PHP String Reference

The Altova MissionKit is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy® - the industry-leading XML editor; MapForce® - a
graphical data mapping, conversion, and integration tool; StyleVision® - a visual XSLT stylesheet designer;
DiffDog® - an XML-aware diff/merge tool; and 2 additional tools.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|