How to compare strings and ignore case sensitivity in PHP

1 Answer

0 votes
$s1 = "php";
$s2 = "PHP";

if (strcasecmp($s1, $s2) == 0) {
    echo 'Match';
} else {
    echo 'Not match';
}



/*
run:

Match

*/

 



answered Aug 12, 2020 by avibootz

Related questions

1 answer 156 views
2 answers 211 views
2 answers 207 views
207 views asked Oct 15, 2015 by avibootz
1 answer 122 views
1 answer 218 views
...