The difference between array_merge and array+array in php
array_merge discards the original numeric key, retains the key in string form, and then forms a new array. No matter whether the key name
is the same, it will not be merged, unless the key name and value are the same at the same time and must be in string form. keys are merged. The thing about array+array is that no matter what your situation is, it will only put the data of the previous array into the newly generated array first, and then see if the second array is larger than the first array. If there are many, more will be added in. It only counts the number, but in this case it will be added in:
$a = array('d'=>'aass','e'=>'adsdfd', 'asd'=>'asdsdd','ddfg'=>'dssdf');
$b = array('d'=>'adddd','adsdfd','asdfsddddd','d'=>'aass' );
$d = $a + $b;
var_dump($d);
var_dump($e);Print: array 'd' => string'aass ' (length=4) 'e' => string'adsdfd'
(length=6) 'asd' => string'asdsdd' (length=6) 'ddfg' => string'dssdf' (length=5) 0
=> string'adsdfd' (length=6) 1 => string'asdfsddddd' (length=10)array 'd' => string'aass' (length=4) 'e' => string'adsdfd'
(length=6) 'asd' => string'asdsdd' (length=6) 'ddfg' => string'dssdf' (length=5) 0
=> string'adsdfd' (length=6) 1 => string'asdfsddddd' (length=10)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

