How to use strncasecmp in PHP
In this article I will explain how strncasecmp function used in PHP.
strncasecmp() Function
This function compares two strings.
and returns:
- 0 - if the two strings are equal
- <0 - if string1 is less than string2
- >0 - if string1 is greater than string2
Note- It is a case-insensitive.
Syntax
strncasecmp(string1,string2,length) |
Example
<html>
<body>
<?php
echo strncasecmp("swati sharma","sachin bhardwaj",6);
?>
</body>
</html> |
Output
You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here