Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $orderDoc = array("ORT", "TRI", "CONT", "RMI");
- $FindDoc= array("RMI0000191","ORT0000379","ORT0000391","ORT0000392","ORT0000390","CONT0000274","CONT0000275","RMI0000192","ORT0000391");
- array(10) {
- [0]=>
- string(10) "RMI0000191"
- [1]=>
- string(10) "ORT0000379"
- [2]=>
- string(10) "ORT0000391"
- [3]=>
- string(10) "ORT0000392"
- [4]=>
- string(10) "ORT0000390"
- [5]=>
- string(11) "CONT0000274"
- [6]=>
- string(11) "CONT0000275"
- [7]=>
- string(10) "RMI0000192"
- [8]=>
- string(10) "ORT0000394"
- [9]=>
- string(10) "TRI0000170"
- }
- $FindDoc=asort($FindDoc,$orderDoc );
- PHP - Sort Functions For Arrays
- In this chapter, we will go through the following PHP array sort functions:
- sort() - sort arrays in ascending order
- rsort() - sort arrays in descending order
- asort() - sort associative arrays in ascending order, according to the value
- ksort() - sort associative arrays in ascending order, according to the key
- arsort() - sort associative arrays in descending order, according to the value
- krsort() - sort associative arrays in descending order, according to the key
- array(10) {
- [0]=>
- string(10) "ORT0000379"
- [1]=>
- string(10) "ORT0000390"
- [2]=>
- string(10) "ORT0000391"
- [3]=>
- string(10) "ORT0000392"
- [4]=>
- string(10) "ORT0000394"
- [5]=>
- string(10) "TRI0000170"
- [6]=>
- string(11) "CONT0000274"
- [7]=>
- string(11) "CONT0000275"
- [8]=>
- string(10) "RMI0000191"
- [9]=>
- string(10) "RMI0000192"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement