answersLogoWhite

0


Best Answer

You cannot sort arrays by other arrays; that wouldn't make sense, anyway.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a PHP function that can sort arrays by other arrays?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you get difference between two or more arrays in PHP?

The inherit function `array_dif($arrayOne, $arrayTwo, $arrayThree, ...)` is likely what you're looking for. It compares two or more arrays, and returns an array of values that are unique among the arrays.


How do you merge arrays in PHP?

To merge arrays in PHP all you have to do is use the array_merge() function like shown below: <?php $array1 = array("Matt", "Michael", "Justin"); $array2 = array("Janice", "Janet", "Kylie"); $array3 = array_merge($array1, $array2); ?> One thing to remember when merging arrays is you might be creating duplicate results, if you don't want 2 or more of the same result in the array remember to use the function array_unique() to remove the duplicate results from it!


How are arrays different in languages other than PHP?

There aren't any (at least none that I'm aware of). In PHP arrays are the same as in all other languages: variables that contain several values at different indices.The only difference between PHP and certain other languages is the way a variable is initialised as an array:$example = array(index => value, index2 => value2);Contrary to other languages, this is similar to a function, as opposed to creating an instance of a class. (JavaScript for example: xyz = new Array();)


How do you sort variable in ascending or descending order both in php?

Assuming that the values are stored in an array, you can use the php function sort($array) to sort ascending, and rsort to sort descending. The following link gives a table that lists all of the built in PHP sort functions: http://php.net/manual/en/array.sorting.php


What is the PHP foreach construct used for?

The PHP foreach construct is used to iterate over arrays. This is done in the field of mathematics. It will issue errors when one tries to use it as a variable instead of arrays and objects.


What language supports associative arrays?

AWK, Perl and PHP are three examples.


Sorting an array in PHP without using sort function?

plz as soon as possible give me the program for shorting an array in asscending order without using any sort function in c++


How do you merge and sort an array using PHP?

To merge and sort an array in PHP you need to use the array_merge() and sort() functions like shown in the example below: <?php $array1 = array(1, 5, 3, 9, 7); $array2 = array(8, 2, 6, 4, 0); // merge the arrays $merge = array_merge($array1, $array2); // 1, 5, 3, 9, 7, 8, 2, 6, 4, 0 // sort the array sort($merge); // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ?>


What is the importance of foreach loop in php?

The foreach construct simply gives an easy way to iterate over arrays. Foreach works only on arrays (and objects).


What is a PHP certificate?

PHP certification is received after doing some sort of PHP course, there are many out there to do. You can use them in your CV to help you get a job in PHP.


How does PHP function in applications?

in php used for one typ website


How do you use settime out in php?

we cant use set timeout function in php because it is of java script function