dimanche 3 mai 2015

Array comparison, get the rank of number

I have a set of number, the purpose is to calculate the probability of permutation and i need to compare the outcome.

1|      974407      |
 |---------|--------|
2| 97440x  | x74407 |
3| 9744xx  | xx4407 |
4| 974xxx  | xxx407 |
5| 97xxxx  | xxxx07 |

This is the format of the information I want to compare. and it's in array format. The information is crawl from other website and the order cannot be changed.

$data = [974407,97440,74407,9744,4407,974,407,97,07]

I need to know the rank. For example:

974123 - rank 4
197400 - no rank
974123 - is not rank 5

Aucun commentaire:

Enregistrer un commentaire