Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Array sort question

General discussions related to php

Moderators: macek, egami, gesf

Array sort question

Postby hinkeltje » Thu Feb 20, 2014 6:14 am

Hi,

I have this array and want to sort it on the second value (the string that says 'inspiratiesessie' or 'masterclass').

It is probably so easy, because I have been searching and trying for over 2 hours and I can't seem to get it to work.

Code: Select all
$trainingen = array(
   array(1, "Inspiratiesessie", "&euro;99", "24 april 2014", "<br/>Deze sessie wordt gehouden van 13:00 tot 17:00 uur in het Planetarium, Amsterdam ZO.<br/><br/>Lees <a href='inspiratiesessies.php'>hier</a> meer over deze training."),
   array(2, "Masterclass", "&euro;299", "2 en 22 mei 2014", "<br/>Deze Masterclass is op 2 niet aaneengesloten cursusdagen (2 en 22 mei) van 9:30 - 17:00 uur in het Planetarium, Amsterdam ZO.<br/><br/>Lees <a href='masterclass.php'>hier</a> meer over deze training."),
   array(3, "Inspiratiesessie", "&euro;99", "19 juni 2014", "<br/>Deze sessie wordt gehouden van 13:00 tot 17:00 uur in het Planetarium, Amsterdam ZO.<br/><br/>Lees <a href='inspiratiesessies.php'>hier</a> meer over deze training."),
   array(4, "Masterclass", "&euro;299", "6 en 26 juni", "<br/>Deze Masterclass is op 2 niet aaneengesloten cursusdagen (6 en 26 juni) van 9:30 - 17:00 uur in het Planetarium, Amsterdam ZO.<br/><br/>Lees <a href='masterclass.php'>hier</a> meer over deze training."),
);



Please help me.

Thanks
User avatar
hinkeltje
New php-forum User
New php-forum User
 
Posts: 15
Joined: Thu Aug 25, 2011 10:51 pm

Re: Array sort question

Postby menator01 » Sat May 10, 2014 4:09 pm

You could have a look at array_multisort and see if that helps..
User avatar
menator01
New php-forum User
New php-forum User
 
Posts: 6
Joined: Sat May 10, 2014 3:29 pm


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.