Hi,
Big problems here. I can't for the life of me get this thing to sort numerically. Here's a sample array:
$order[sandwich][45678][3][0][text] = 'Butter';
$order[sandwich][45678][1][0][text] = 'Cheddar Cheese';
$order[sandwich][45678][0][0][text] = 'Bread';
$order[sandwich][45678][1][1][text] = 'Leicester Cheese';
$order[sandwich][45678][9][0][text] = 'Pickle';
As you will see, the array takes the following steps:
sandwich- this means it is processed by the sandwichfunctions in the basket.
45678 - this is the unique ID for this sandwich.
1,3,0,9 - these are the category IDs of the components such as Cheeses stored in a mysql table.
0,0,0,1,0 - these are incremental so you can have more than one type of cheese for example.
text - this is the descriptive name for the component, others include ID which links to the item in a db.
OK, what I'm trying to do is sort this array by the 1,3,0,9 values (so it goes bread, cheese, butter, pickle) but am having no luck!
All the data is being messed up and I'm getting nowhere. Remember the can be other food types such as 'rolll', further 'roll' IDs etc..
Any ideas?
Sorting multidimensional array
Moderator: General Moderators
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact: