• PHP Video Tutorials

PHP - Function Strcasecmp



Syntax

int strcasecmp ( string $str1 , string $str2 )

Definition and Usage

It is used to compare two strings

Return Values

It returns string functions, it may 0 or <0 or 0>.

Parameters

Sr.No Parameters & Description
1

string1

It specifies the first string to compare

2

String2

It specifies second string to compare

Example

Try out the following example

<?php
   echo strcasecmp("Hello world!","tutorials WORLD!");
?>

This will produce following result −

-12
php_function_reference.htm
Advertisements