Find problems
See a piece of code today, is so written, feel unfamiliar, the following paste out to see:
<?php
$array _one = [content];
$array _two = [content];
The key here
$array _result = $array _one + $array _two;
echo "<pre/>";
Print_r ($array _result);
? >
What I feel strange is that the array is added directly to the array $array_one
, and $array_two
I did the array merging operation in accordance with the array_merge()
function, and I did not use the above method directly to do the operation.
Analysis is as follows
Here's a brief description of the difference between this approach and array_merge()
the way the function is. When the "+" number is used for direct operation, is based on the array preceded by the "+" number, and if the array following the "+" number is exactly the same as the preceding array (exactly the same as the key and the value is the same), the data in the preceding array is the same. If you use the array_merge()
opposite, you are using the following array as the benchmark.
Summarize
The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.