I have 2 arrays containing starting poker hold'em hands.
One is composed of unordered values.
$array1 = array("65s","AA","J9s","AA","32s");
//the cards can be repeated here as you see there are 2 "AA"
and the other one that should be used as a model to order the first array:
$array_sorted = array("AA","KK","AKs"...);
//here the cards are not repeated
I'd like to re-order $array1 with the sort used in $array_sorted,
it should return an array like:
$array1 = array("AA","AA","J9s","65s","32s");
I have completely no idea on how to accomplish this. Maybe by using some "user defined sorting method"? Really don't know.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…