Jump to content

multisort()


karthikanov24

Recommended Posts

hi

 

array_multisort($parent);

 

$parent displays the following array before multisorting...as follows..

 

Array ( [0] => Array ( [cat_id] => 15 [cat_parent_id] => 12 [cat_name] => Mercedes-Benz [cat_image] => e40c0b24095b3b5284cb5f64ab394b5a.jpg [cat_description] => Expensive but real good ) [1] => Array ( [cat_id] => 14 [cat_parent_id] => 12 [cat_name] => Volvo [cat_image] => 45ad4ebcdc58193534aabc6dc9c1a022.jpg [cat_description] => Swedish luxury car ) )

 

After using array_multisort() as shown in the code it displays as follows...

 

Array ( [0] => Array ( [cat_id] => 14 [cat_parent_id] => 12 [cat_name] => Volvo [cat_image] => 45ad4ebcdc58193534aabc6dc9c1a022.jpg [cat_description] => Swedish luxury car ) [1] => Array ( [cat_id] => 15 [cat_parent_id] => 12 [cat_name] => Mercedes-Benz [cat_image] => e40c0b24095b3b5284cb5f64ab394b5a.jpg [cat_description] => Expensive but real good ) )

 

 

what has been changed here after using array_multisort() in the above array...?

(how it is sorted..?)

 

thanks

karthikanov24

Link to comment
https://forums.phpfreaks.com/topic/180652-multisort/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.