• 首页
  • PHP
  • 前端
  • OpenCart
  • ZenCart
  • Wordpress
  • Linux
  • MySQL
  • C语言
  • 感悟
  • 网络编程
  • 关于

array_merge重写字段数据

作者:老J 时间:2018-06-21 分类:PHP
>>> $_config = array('db_host' => 'localhost', 'db_user' => 'edu', 'db_pwd' => 'edu','db_name' => 'edu', 'db_lang' => 'utf8', 'db_prefix' => 'edu_', 'pconnect' => 0,'debug'=>1);
=> [
     "db_host" => "localhost",
     "db_user" => "edu",
     "db_pwd" => "edu",
     "db_name" => "edu",
     "db_lang" => "utf8",
     "db_prefix" => "edu_",
     "pconnect" => 0,
     "debug" => 1,
   ]
>>> 
>>> 
>>> 
>>> $c =  array('db_host' => 'localhost', 'db_user' => 'root', 'db_pwd' => 'xx','db_name' => 'pcdd2', 'db_lang' => 'utf8', 'db_prefix' => 'un_', 'pconnect' => 0,'debug'=>1)
=> [
     "db_host" => "localhost",
     "db_user" => "root",
     "db_pwd" => "xx",
     "db_name" => "xxx",
     "db_lang" => "utf8",
     "db_prefix" => "un_",
     "pconnect" => 0,
     "debug" => 1,
   ]
>>> 
>>> 
>>> array_merge($_config,$c)
=> [
     "db_host" => "localhost",
     "db_user" => "root",
     "db_pwd" => "xx",
     "db_name" => "xxx",
     "db_lang" => "utf8",
     "db_prefix" => "un_",
     "pconnect" => 0,
     "debug" => 1,
   ]
>>>

LayBlog 强力驱动.
本站重建于2017年12月2日.
部分内容来自网络,如有问题,请联系站长处理.
友情链接: 珠海拖鞋仔博客 | 沉默是金