Home >> PHP >> natcasesort() function in PHP

natcasesort() function in PHP

The natcasesort() function(case insenstive) using for sorts an array by using a natural order algorithm.

Syntax

natcasesort(array)

Example

$array = array('IMG0.png', 'img12.png', 'img10.png', 'img1.png', 'IMG3.png');

natcasesort($array);

print_r($array);

Output

Array ( [0] => IMG0.png [3] => img1.png [4] => IMG3.png [2] => img10.png [1] => img12.png )
 

Post Your Comment

Next Questions
natsort() function
pos() function
prev() function
range() function
reset() function
rsort() function
shuffle() function
sizeof() function
sort() function
uasort() function
uksort() function
usort() function
What is the difference between array_combine() and array_merge()
What are the differences between array_diff(), array_diff_assoc() and array_diff_key()
What is the difference between array_intersect_assoc() and array_intersect_key()
What is difference between array_push() and array_pop()
What is difference between array_product() and array_sum()
What is the difference between session and cookie
What is session & work
What are data types
What are super global variable
$GLOBALS super global variable
$_SERVER super global variable
$_REQUEST super global variable
$_POST super global variable

Copyright ©2022 coderraj.com. All Rights Reserved.