Tip: Append to an array with + operator August 8th, 2009

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.

Tip: Don’t close your PHP tags August 8th, 2009

Adding a closing ?> to your <?php tags is actually optional, and you should avoid using it for scripts that will only be included.

Read the rest of this entry »