PHP string strcasecmp() functionLast Updated : 17 Mar 2025 PHP string strcasecmp() is predefine function. It is used to compare two given string. It is binary safe and case-insensitive. It is similar to the strncasecmp() function. It returns:
Syntax:
Example 1Output: Your first string is:JavaTPOINT Your second string is:JAVAtpoint 0 Example 2Output: By using strcasecmp() function:0 using strcasecmp() function:0 Example 3Output: -75 -7 Example 4Output: $str is equal to $vstr2 in a case-insensitive string comparison Reference: http://php.net/manual/en/function.strcasecmp.phpNext TopicPHP String |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India