Skip to content

Comparison

Strings can be compared using comparison operators or functions.

Common functions include:

  • strcmp()
  • strcasecmp()
$result = strcmp("apple", "banana");
echo $result;