strcmp()
functionYou can use the PHP strcmp()
function to easily compare two strings. This function takes two strings str1
and str2
as parameters. The strcmp()
function returns < 0
if str1
is less than str2
; returns > 0
if str1
is greater than str2
, and 0 if they are equal.
Let's check out an example to understand how this function basically works:
<?php
$str1 = "Hello";
$str2 = "Hello World";
echo strcmp($str1, $str2); // Outputs: -6
?>
i hope you like this small article.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on harsukh21@gmail.com
How to add attributes to an HTML element in jQuery
Use the jQuery attr() method You can...Laravel 8 - Create Contact in ZOHO Crm Tutorial Example
In this article, I will share with you h...How to Create REST API in Laravel7 using Passport
Hey Artisan Hope you are doing well....PHP Count Number of Pages in PDF File
In this post, I will give you a simple e...How to move an element to left, right, up and down using arrow keys in jQuery
Use the jQuery keydown() method You c...