strncmp()

It compares  first n characters (case-sensitive) of a strings

Example

<?php
echo strncmp(“phpcode”,”codez”,7);
?>

Output

1

Share