gpt4 book ai didi

PHP随机匹配一个数组到自身

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:47:25 27 4
gpt4 key购买 nike

<分区>

示例数组:

$player = array("lawrence","joey","jason","joel","bianca","paulo","albert");

我想将一个数组与其自身匹配,以便它从自身获取一个值而不获取重复值:

"lawrence" => "lawrence"; //must not contain itself
"joey" => "lawrence"; //must not assign value already assigned to that value

简而言之:它就像一个交换礼物算法

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com