PHP-How To Pair Up items in Array based on condition

前端 未结 3 1534
甜味超标
甜味超标 2021-02-04 16:07

How can I pair up items in an array? Let\'s say I have an array of Fighters. And I want to pair them up based on their Weights. Fighters with c

3条回答
  •  臣服心动
    2021-02-04 16:38

    Sort the array by weight. You will then have pairs of weights that are close to each other.

提交回复
热议问题