Lets say I have the following data:
$data = array('av','ds','tg','ik','pk','np','rq');
I'm having trouble finding out what tools to use to get the range of strings between two variables.
function sortrange ( $a, $b, $data )
{
return $range;
}
For example:
sortrange('ds','np', $data);
Would return
array('ds','tg','ik','pk','np');
I would also like it be able to do backwards sorting, for example:
sortrange('np','tg');
Would return:
array('np','pk','ik','tg');
The closest function I found that might be usable was usort, but it couldn't get anywhere close to what I wanted.
Thanks for any help in advance. :)