欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php数组函数之array_combine() 数组合并函数

程序员文章站 2022-03-18 09:05:32
...
  1. $a1=array("a","b","c","d");
  2. $a2=array("Cat","Dog","Horse","Cow");
  3. print_r(array_combine($a1,$a2));
  4. ?>
复制代码

输出: Array ( [a] => Cat => Dog [c] => Horse [d] => Cow )