ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1、array_merge():合并多个数组,组成新的数组: $arry1 = array('webname'=>'fxxy','weburl'=>'http://www.baidu.com'); $arry2 = array('dede_user'=>'root','dede_pwd'=>'123456'); echo '<pre>'; print_r(array_merge($arry1,$arry2)); 运行结果: Array ( [webname] => fxxy [weburl] => http://www.baidu.com [dede_user] => root [dede_pwd] => 123456 ) 2、array_merge_recursive():合并多个数组,如果键名相同,则生成多维数组: $arry1 = array('webname'=>'fxxy','weburl'=>'http://www.baidu.com'); $arry2 = array('webname'=>'百度','weburl'=>'http://www.baidu.com'); echo '<pre>'; print_r(array_merge_recursive($arry1,$arry2)); 运行结果: Array ( [webname] => Array ( [0] => fxxy [1] => 百度 ) [weburl] => Array ( [0] => http://www.baidu.com [1] => http://www.baidu.com ) )