from array output date from monday to friday

  arrays, php, sorting

I would like to output below array in a week base format from Monday to friday like:

OUTPUT:

Mi 06.01. – Fr 08.01.

Mo 11.01. – Fr 15.01.

Any suggestions how i can exclude the weekdays in between?

  [0]=>
  string(9) "Mi 06.01."
  [1]=>
  string(9) "Do 07.01."
  [2]=>
  string(9) "Fr 08.01."
  [3]=>
  string(9) "Mo 11.01."
  [4]=>
  string(9) "Di 12.01."
  [5]=>
  string(9) "Mi 13.01."
  [6]=>
  string(9) "Do 14.01."
  [7]=>
  string(9) "Fr 15.01."
  [8]=>
  string(9) "Mo 18.01."
  [9]=>
  string(9) "Di 19.01."
  [10]=>
  string(9) "Mi 20.01."
  [11]=>
  string(9) "Do 21.01."
  [12]=>
  string(9) "Fr 22.01."
  [13]=>
  string(9) "Mo 25.01."
  [14]=>
  string(9) "Di 26.01."
  [15]=>
  string(9) "Mi 27.01."
  [16]=>
  string(9) "Do 28.01."
  [17]=>
  string(9) "Fr 29.01."
}

Source: Ask PHP

LEAVE A COMMENT