From this array below I want to pickup the Min. Number > 0
in this case 46 with key 8. How would I achieve that without
re-arranging the array.
Note: The key is quite important, so sorting it any order or deleting elements < 0 will not help as I will lose the key. The key reference from here will be used to pickup another data from another array.
Also note this is an example, Min. number > 0 can be anywhere, and array count can be longer than this too.
And yes, Array index starts from 1 for simplicity purpose.
Array
(
[1] => 816
[2] => 746
[3] => 646
[4] => 546
[5] => 446
[6] => 346
[7] => 246
[8] => 46
[9] => -254
[10] => -354
[11] => -554
[12] => -654
[13] => -754
)
Any help will be appreciated.
Thanks.
Bij.