25 January 2022

How to get dates from range of dates in PHP?

 <?php

$string = explode('-','8/12/2013-19/11/2013');


 $date1 = explode('/',$string[0]);

 $date2 = explode('/',$string[1]);


echo $finalDate1 = $date1[0].'-'.$date1[1].'-'.$date1[2];

echo '<br>';

echo $finalDate2 = $date2[0].'-'.$date2[1].'-'.$date2[2];

?> 

No comments:

Post a Comment

How to create video slider with cuncks of videos without download all videos?

 Create video slider with cuncks of videos without download all videos function custom_video_slider_shortcode() { $slider_id = 'vide...