I have a code like this
$events = array(
array(
"id" => 101,
"start_date" => "2016-04-05 08:00:00",
"end_date" => "2016-04-09 09:00:00",
"text" => "text1",
"rec_type" => "week_2___3,5",
"event_pid" => null,
"event_length" => 3600
),
array(
"id" => 102,
"start_date" => "2016-04-06 12:00:00",
"end_date" => "2016-04-06 18:00:00",
"text" => "text2",
"rec_type" => "",
"event_pid" => null,
"event_length" => null
),
array(
"id" => 103,
"start_date" => "2016-04-07 12:00:00",
"end_date" => "2016-04-07 18:00:00",
"text" => "text3",
"rec_type" => "",
"event_pid" => null,
"event_length" => null
),
array(
"id" => 104,
"start_date" => "2016-04-08 12:00:00",
"end_date" => "2016-04-08 18:00:00",
"text" => "text4",
"rec_type" => "",
"event_pid" => null,
"event_length" => null
)
);
Now I should get some data from MySQL and make this dynamically but maintaining the variable $events the same as there.
I have tried in some way with while and for, but maybe I made some mistake in the syntax.
$eventsto store both arrays ? or you just want codes to iterate over the above array ?