Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. $orderDoc = array("ORT", "TRI", "CONT", "RMI");
  2.  
  3. $FindDoc= array("RMI0000191","ORT0000379","ORT0000391","ORT0000392","ORT0000390","CONT0000274","CONT0000275","RMI0000192","ORT0000391");
  4.  
  5. array(10) {
  6. [0]=>
  7. string(10) "RMI0000191"
  8. [1]=>
  9. string(10) "ORT0000379"
  10. [2]=>
  11. string(10) "ORT0000391"
  12. [3]=>
  13. string(10) "ORT0000392"
  14. [4]=>
  15. string(10) "ORT0000390"
  16. [5]=>
  17. string(11) "CONT0000274"
  18. [6]=>
  19. string(11) "CONT0000275"
  20. [7]=>
  21. string(10) "RMI0000192"
  22. [8]=>
  23. string(10) "ORT0000394"
  24. [9]=>
  25. string(10) "TRI0000170"
  26. }
  27.  
  28. $FindDoc=asort($FindDoc,$orderDoc );
  29.  
  30. PHP - Sort Functions For Arrays
  31. In this chapter, we will go through the following PHP array sort functions:
  32.  
  33. sort() - sort arrays in ascending order
  34. rsort() - sort arrays in descending order
  35. asort() - sort associative arrays in ascending order, according to the value
  36. ksort() - sort associative arrays in ascending order, according to the key
  37. arsort() - sort associative arrays in descending order, according to the value
  38. krsort() - sort associative arrays in descending order, according to the key
  39.  
  40. array(10) {
  41. [0]=>
  42. string(10) "ORT0000379"
  43. [1]=>
  44. string(10) "ORT0000390"
  45. [2]=>
  46. string(10) "ORT0000391"
  47. [3]=>
  48. string(10) "ORT0000392"
  49. [4]=>
  50. string(10) "ORT0000394"
  51. [5]=>
  52. string(10) "TRI0000170"
  53. [6]=>
  54. string(11) "CONT0000274"
  55. [7]=>
  56. string(11) "CONT0000275"
  57. [8]=>
  58. string(10) "RMI0000191"
  59. [9]=>
  60. string(10) "RMI0000192"
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement