Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function workTimeFormat($DATA) {
- if(is_array($DATA)) {
- $arDays = Array('Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс');
- $newArray = Array();
- $prevTime = false;
- $newArrPrevIndex = 0;
- foreach($DATA as $INDEX => $TIME) {
- if($TIME == $prevTime) {
- $newArray[$newArrPrevIndex-1][$INDEX] = $TIME;
- } else {
- $newArray[][$INDEX] = $TIME;
- $newArrPrevIndex++;
- }
- $prevTime = $TIME;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement