MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

PHP Programing language

array_multisort() Function in PHP
Previous Home Next

array_multisort()

The array_multisort() function returns a sorted array. You can assign one or more arrays. The function sorts the first array, and the another arrays follow, then, if two or more values are the same, it sorts the next array, and so on.

Syntax:
array_multisort(array1,sorting order,sorting type,array2,array3...)

In above syntax, "array1" specifies an array, "sorting order" specifies the sorting order and values are as follows:

  • SORT_ASC: Sort in ascending order and is default order (A-Z)
  • SORT_DESC: Sort in descending order (Z-A)
"sorting type" specifies the type to use, when comparing elements and values are as follows:
  • SORT_REGULAR: Compare elements normally (Standard ASCII) and is default type
  • SORT_NUMERIC: Compare elements as numeric values
  • SORT_STRING: Compare elements as string values
  • SORT_LOCALE_STRING: Compare elements as string, based on the current locale (can be changed using setlocale())
  • SORT_NATURAL: Compare elements as strings using "natural ordering" like natsort()
  • SORT_FLAG_CASE: Can be combined (bitwise OR) with SORT_STRING or SORT_NATURAL to sort strings case-insensitively
"array2" specifies an array and "array3" specifies an array

 

Example:

<?php
$array1=array("Apple","Banana","Orange");
$array2=array("Onion","Tomato","Potato");
array_multisort($array1,$array2);
print_r($array1);
print_r($array2);
?>

Output:

Array ( [0] => Apple [1] => Banana [2] => Orange ) Array ( [0] => Onion [1] => Tomato [2] => Potato )

Previous Home Next