Hi,
Is there a simple way to sort the following array structure by the array cell 'title'=>'TXxxxxx'?
$x[0][0] = array(array('id'=>1,'title'=>'TXxxxxx'),array('id'=>2,'title'=>'T2')); $x[0][1] = array('id'=>10,'title'=>'Test1'); $x[1][0] = array(array('id'=>3,'title'=>'TXxxxxx'),array('id'=>6,'title'=>'T3')); $x[1][1] = array('id'=>11,'title'=>'Test2'); .
i am not a pro but what about rearranging the array so every element is containing its position, in stead of this being in the array structure?
Suppose i name [0][0] to [pos1][ pos2]
and each element would be an array of id,title, pos1,pos2:
with your example:
$x[]=array (1,'TXxxxxx',0,0),
$x[]=array (2,'T2',0,0)
$x[]=array (10,'Test1',0,1);
$x[]=array (3,'TXxxxxx',1,0)
$x[]=array (6,'T3',1,0)
$x[]=array (11,'Test2',1,1);
this would also be easy to smite in a database and then you can get it out by writing a query with ORDER by title
But if you need to redo all your functions now, forget it.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php