How to combine two PHP code lines with $array[$key] into one? Learn effective methods for optimizing PHP code with array_merge and spread operator.