1<?php
2$var1 = "Hello";
3$var2 = "hello";
4if (strcmp($var1, $var2) !== 0) {
5 echo '$var1 is not equal to $var2 in a case sensitive string comparison';
6}
7?>
1//In php to compare two string we can use strcmp() function
2Syntax
3strcmp(string1,string2);
4
5//If both string is same then it will return 0
6<?php
7echo strcmp("Hello world!","Hello world!");
8?>