Jump to: navigation, search

Php strcasecmp

From w3cyberlearnings

Contents

PHP function strcasecmp

This function compares two strings, and it is case insensitive and is binary safe.

Syntax strcasecmp

  • string1: input 1
  • string2: input 2
strcasecmp(string1, string2)

Return

  • 0: when two string equal.
  • >0: string1 is greater than string2.
  • <0: string2 is greater than string1.

Example 1

<?php

echo strcasecmp("Great Day","Great day");
?>

Output: string1=string2

0

Example 2

<?php

echo strcasecmp("Good","good");
?>

Output

0

Related Functions


Navigation
Web
SQL
MISC
References