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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.