- print_r: documentation ( source)
<?php
$month = [
'January',
'January',
'January',
'January',
'February'
];
$weeks = [
'Week 1',
'Week 2',
'Week 3',
'Week 4',
'Week 1'
];
$newArray = [];
foreach ($month as $index => $value) {
// Create the new string you want, using the same index for both arrays
$newArray[] = $value . ' - ' . $weeks[$index];
}
print_r($newArray);