0

I have a PHP array of DateTime objects like this:

Array ( [0] => 2019-04-16 [1] => 2019-04-17 [2] => 2019-04-18 [3] => 2019-04-19 )

I hold this array in a PHP variable $oldArraytep. At runtime i build a calendar and i want to highlight specific dates that are in the $oldArraytep array.

To do this i was planning on:

  1. converting the php array to javascript array
  2. at run time check if there is a specific myJavascriptArray.includes(date("Y-m-d", (timeinmilli/1000)));

Where i am completely lost is on how to convert a php array of DateTime into an javascript array of date

codeNinja
  • 1,442
  • 3
  • 25
  • 61

0 Answers0