Answers for "php strcmp"

PHP
2

php compare string

<?php
$var1 = "Hello";
$var2 = "hello";
if (strcmp($var1, $var2) !== 0) {
    echo '$var1 is not equal to $var2 in a case sensitive string comparison';
}
?>
Posted by: Guest on December-02-2020
3

string compare in php

//In php to compare two string we can use strcmp() function
Syntax
strcmp(string1,string2);

//If both string is same then it will return 0
<?php
echo strcmp("Hello world!","Hello world!");
?>
Posted by: Guest on June-04-2020
1

strcmp php

// This function is used to find whether two strings are same or not.
// Syntax
strcmp(string1,string2);
// It returns
// 0 if string1 and string2 are same
// less than zero if string1 is smaller than string2
// greater than zero if string1 is greater than string2
Posted by: Guest on June-20-2021
0

strcmp php

strcmp("5", 5) => 0
Posted by: Guest on November-04-2020

Browse Popular Code Answers by Language