PHP

PHP Menu

PHP

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

Definition

The strcasecmp() function compares two strings.

Syntax

strcasecmp(string1, string2)

Parameters

Parameter Description
string1 Required. Specifies the first string to compare.
string2 Required. Specifies the second string to compare.

Example

<?php
echo strcasecmp("Welcome to PHP!", "welcome to php!") . "<br>"; echo strcasecmp("Welcome!", "welcome to php.") . "<br>";

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods