<?php $hot = array( 'hotObj 1', 'hotObj 2', 'hotObj 3', 'hotObj 4', ); $new = array( 'newObj 1', 'newObj 2', ); $count = (count($hot) > count($new)) ? count($hot) : count($new); $result = []; for($i= 0; $i < $count;$i++){ if(isset($hot[$i])){ $result[] = $hot[$i]; } if(isset($new[$i])){ $result[] = $new[$i]; } } print_r($result);
You have javascript disabled. You will not be able to edit any code.