gordon142 Posted August 27, 2009 Share Posted August 27, 2009 I have a number of numerical values in an array. I want to take another value and search the array for the first value in the array that is larger than the other value (the one not in the array). I've tried various methods with in_array but can never get it to do anything except return a parsing error. Help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/172150-greater-than-less-than-in-in_array/ Share on other sites More sharing options...
akitchin Posted August 27, 2009 Share Posted August 27, 2009 one option is to append the value into the array with a specific key, sort the array while preserving keys, and then move the array pointer to the element now located AFTER the one you just tossed in. Link to comment https://forums.phpfreaks.com/topic/172150-greater-than-less-than-in-in_array/#findComment-907700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.