PHP Programing language

strcmp() Functions in PHP
Previous Home Next

strcmp()

The strcmp() function compares two strings. This function returns:

  1. 0 if the two strings are equal
  2. <0 if string1 is less than string2
  3. >0 if string1 is greater than string2
Syntax :
strcmp("string1","string2");

 

Example:

<?php 
echo strcmp("Gud Morning!","Gud Morning!!!"); 
?>

Output:

-2

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: