3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getLineChartPromedio($format = 'Y-m-d'){ $startDate = '2020-07-08'; //$this->input->post('startDate'); $endDate = '2020-07-12'; //$this->input->post('endDate'); // Declare an empty array $arraydias = array(); // Variable that store the date interval // of period 1 day $interval = new DateInterval('P1D'); $realEnd = new DateTime($endDate); $realEnd->add($interval); $period = new DatePeriod(new DateTime($startDate), $interval, $realEnd); // Use loop to store date into array foreach($period as $date) { $fecha = $date->format($format); $arraydias[] = $fecha; } $string = "'" . implode("','", $arraydias) . "'"; echo json_encode($string); } getLineChartPromedio();
Output for git.master, git.master_jit, rfc.property-hooks
"'2020-07-08','2020-07-09','2020-07-10','2020-07-11','2020-07-12'"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.58 ms | 405 KiB | 5 Q