Definition
The strcmp() function compares two strings. This function is binary-safe and case-sensitive.
Syntax
strcmp(string1, string2)
Parameters
Parameter | Description |
---|---|
string1 |
Required. Specifies the first string to compare. |
string2 |
Required. Specifies the second string to compare. |
Example
<?php
echo strcmp("Welcome to PHP!", "welcome to php!");