PHP

PHP Menu

PHP

strncasecmp() Function - Definition, Syntax, Parameters, Examples

Definition

The strncasecmp() function compares(binary-safe and case-insensitive) two strings.

Syntax

strncasecmp(string1, string2, length)

Parameters

Parameter Description
string1 Required. Specifies the first string to compare.
string2 Required. Specifies the second string to compare.
length Required. Specify the number of characters from each string to be used in the comparison.

Example

<?php
echo strncasecmp("Welcome to PHP!","welcome to Php!", 7);

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods