How to compare two strings in PHP?

Posted by Prem Tiwari | Updated on

Answer: Use the PHP strcmp() function

Want to compare two strings using PHP, use the PHP strcmp() function to compare two strings. Following is an example of compare two strings values using PHP:

Example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers