Example 1 — Ignore Letter Case
Two strings that differ only in case count as equal.
<?php
$result = strcasecmp("Hello", "hello");
if ($result === 0) {
echo "Equal", PHP_EOL;
} else {
echo "Different", PHP_EOL;
} How It Works
- Pass two strings. They differ only in the first letter's case.
- Case is ignored.
Handhmatch. - Get 0. That means the strings are equal.
- Check with === 0. Do not rely on a plain
if.

