• PHP Video Tutorials

PHP - Function Strnatcmp



Syntax

int strnatcmp ( string $str1 , string $str2 )

Definition and Usage

It is used compare two strings with a natural order algorithm.

Return Values

It returns the string functions

Parameters

Sr.No Parameters & Description
1

string1

It specifies first string to search

2

string2

It specifies second string to search

Example

Try out the following example

<?php
   echo strnatcmp("2sairam", "2kittuprasad");
?>

This will produce following result −

1
php_function_reference.htm
Advertisements