企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ $a = [ 'id', 'name', 'identityId', 'phone', 'email', 'schoolId' ]; $b = [ 'id' => '唯一标识', 'identityId' => '身份证', 'phone' => '手机号', 'email' => '邮箱', 'name' => '姓名', 'schoolId' => '学校' ]; var_dump(array_merge(array_flip($a), $b)); $arr1 = array( 'id', 'name', 'identityId', 'phone', 'email', 'schoolId' ); $arr2 = array( 'id' => '唯一标识', 'identityId' => '身份证', 'phone' => '手机号', 'email' => '邮箱', 'name' => '姓名', 'schoolId' => '学校', ); array_multisort($arr1,SORT_DESC,$arr2); print_r($arr2); // 结果为: Array ( [schoolId] => 学校 [email] => 邮箱 [identityId] => 身份证 [phone] => 手机号 [id] => 唯一标识 [name] => 姓名 ) $c = array(); foreach ($a as $value) $c[$value] = $b[$value]; print_r($c); ~~~