redarrow Posted May 10, 2006 Share Posted May 10, 2006 how do i explode the dates fom dates1 to dates4.[code]$dates1$dates2$dates3$dates4date format is day month year ("d-m-y")01-06-2006[/code]example[code]<?datbase connectionwhile loop with $row {dates1=$row["dates1"];$getdate=explode("$d","-","$m","-","$y",$dates1) {$a=$d;$b=$m;$c=$y;}}ecoho "date is day $a and month is $b and year is $c":?>[/code] Link to comment https://forums.phpfreaks.com/topic/9460-explode/ Share on other sites More sharing options...
wildteen88 Posted May 10, 2006 Share Posted May 10, 2006 If I am correct in think that you want to seperate the day, moth and year numbers into sepearte variables?If thats the case then you'll want to do something like this:[code]$date1 = "10-05-206";list($day, $month, $year) = explode("-", $date1);echo "date is day $a and month is $b and year is $c";[/code] Link to comment https://forums.phpfreaks.com/topic/9460-explode/#findComment-34870 Share on other sites More sharing options...
redarrow Posted May 10, 2006 Author Share Posted May 10, 2006 [!--quoteo(post=372873:date=May 10 2006, 10:46 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 10 2006, 10:46 AM) [snapback]372873[/snapback][/div][div class=\'quotemain\'][!--quotec--]If I am correct in think that you want to seperate the day, moth and year numbers into sepearte variables?If thats the case then you'll want to do something like this:[code]$date1 = "10-05-206";list($day, $month, $year) = explode("-", $date1);echo "date is day $a and month is $b and year is $c";[/code][/quote]wildteen can you have a quick look at my post please confused mate.[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=93112\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=93112[/a] Link to comment https://forums.phpfreaks.com/topic/9460-explode/#findComment-34877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.