Let's say I have an array like the following.
[0] => Array
[0] => Peter drives 45km to work
[1] => Tom rides 32km with his friends
[2] => Lisa walks 6km to the gym
[3] => Bob cycles 12km to keep fit
[4] => Bill takes the train 63km to work
[5] => Penny runs 8km to the shop
[6] => Robert takes a taxi 21km to the museum
Suppose I want to keep only the people who travelled between 10-15km and remove all others from the array. Also, suppose the range I want to use is variable, ie: today I might like to see who travelled between 10-15km, but tomorrow I might like to see who travelled between 5-15km, then the next day I might like to see who travelled between 30-50km.
How would I go about searching through this array and either removing all the elements that do not fall within my specified range, or moving the elements I require to a new array?
With regard to the elements I require, I need to retain the entire value, not just the distance travelled.