Tip: Append to an array with + operator

You can use the addition and increment operators in PHP to concatenate arrays. For example, $c = $a + $b;

If you’ve used array_merge() to do this in the past, it’s important to note the difference between merging arrays and concatenating them. When you merge they keys are used to determine how the resulting array is formed. When you concatenate the values are added together.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

No Comments

Post a Comment

Your email is never shared. Required fields are marked *