Search
 
SCRIPT & CODE EXAMPLE
 

PHP

compare strings alphabetically php

Use strcmp.
If the first argument to strcmp is lexicographically smaller to the second, then the value returned will be negative.
If both are equal, then it will return 0.
And if the first is lexicograpically greater than the second then a positive number will be returned.

Bonus fact: You probably want to use strcasecmp(string1,string2), which ignores case.
Comment

PREVIOUS NEXT
Code Example
Php :: php variable undefined inside function argument 
Php :: get next day date in php 
Php :: encrypt number 
Php :: Database connection use for validation in laravel 8 
Php :: Validating data received via the Web App php 
Php :: search a file name and open that file phpstrom 
Php :: Définir un nombre maximum de mots sur les titres des publications WordPress 
Php :: php calculate age as float 
Php :: php explode and typecast 
Php :: magento update attribute value without using object manager 
Php :: Laravel eger loading relationship with selected column 
Php :: df/mpdf/src/Cache.php on line 21 
Php :: SQLSTATE[HY000]: General errorstring(58) 
Php :: show all tags 
Php :: multiple submit button form to multiple php files 
Php :: check which php.ini file enabled from code 
Php :: get base class name laravel 
Php :: ph address format 
Php :: drupal 9 custom access checking for routes 
Php :: merge three array in php 
Php :: rewrite rule wp blog to subdirectory 
Php :: Laravel - foreach on collection 
Php :: set owner symfony 
Php :: wp post view1 
Php :: Do not call the observer when there is a model update in laravel 
Php :: check input value is not empty or spaced php 
Php :: composer new project laravel acl 
Php :: Laravel 8 Factory - One To Many (Polymorphic) Relationship 
Php :: php unit testAdd Answer 
Php :: country 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =