Witam serdecznie po dłuższej nieobecności - mam chyba proste pytanie jak zrobic zeby kilka zmiennych na raz otrzymalo jedną wartość? A moze jakos prosciej nie kombinujac sie to da zrobic? Kod jest taki:
array_multisort ($newdateins, SORT_ASC
, $dateins, $dateouts, $titles, $citys, $streets, $places, $userss, $rozpoczecies, $zakonczenies);
list
($year, $month, $day) = split('[/.-]', $dateins[0
]);list
($year1, $month1, $day1) = split('[/.-]', $dateins[1
]);list
($year2, $month2, $day2) = split('[/.-]', $dateins[2
]);
if ($month == '01') {$month = 'STY';}
else if ($month == '02') {$month = 'LUT';}
else if ($month == '03' || $month1 == '03' || $month2 == '03') {$month = 'MAR' || $month1 = 'MAR' || $month2 = 'MAR';}
else if ($month == '04') {$month = 'KWI';}
else if ($month == '05') {$month = 'MAJ';}
else if ($month == '06') {$month = 'CZE';}
else if ($month == '07') {$month = 'LIP';}
else if ($month == '08') {$month = 'SIE';}
else if ($month == '09') {$month = 'WRZ';}
else if ($month == '10') {$month = 'PAŹ';}
else if ($month == '11') {$month = 'LIS';}
else if ($month == '12') {$month = 'GRU';}
$dzien = 'dni';
if ($rozpoczecies[$i] == 1)
{
$dzien = 'dzień';
}
i teraz o co chodzi:
- chce najlepiej zeby wpisac sobie oddzielne daty dla $month[0], $month[1] $month[2] i dla $day[0], $day[1], $day[2] - oczywiscie po prostu zeby zamienial mi we wszystkich numer miesiaca na 3 pierwsze litery
edit: rozumiem, że to jedyna opcja?
for($x = 0; $x < 3; $x++)
{
list
($year[$x], $month[$x], $day[$x]) = split('[/.-]', $dateins[$x]);
if ($month[$x] == '01') {$month[$x] = 'STY';}
else if ($month[$x] == '02') {$month[$x] = 'LUT';}
else if ($month[$x] == '03') {$month[$x] = 'MAR';}
else if ($month[$x] == '04') {$month[$x] = 'KWI';}
else if ($month[$x] == '05') {$month[$x] = 'MAJ';}
else if ($month[$x] == '06') {$month[$x] = 'CZE';}
else if ($month[$x] == '07') {$month[$x] = 'LIP';}
else if ($month[$x] == '08') {$month[$x] = 'SIE';}
else if ($month[$x] == '09') {$month[$x] = 'WRZ';}
else if ($month[$x] == '10') {$month[$x] = 'PAŹ';}
else if ($month[$x] == '11') {$month[$x] = 'LIS';}
else if ($month[$x] == '12') {$month[$x] = 'GRU';}
}