Selecting 1 of many arrays based on contents in PHP

I have a string:

hi - a - something;bye - b - else;huh - c - here)

that i’m exploding into multiple arrays

array(hi,a,something)
array(bye,b,else)
array(huh,c,here)

i only want one of these arrays though and which one depends on the 2nd variable in each array with following criteria:

d > b > a > e > c > anything else

so in this case, i need the code to select array(bye,b,else) as the one to use

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s