Jump to content


Photo

explode


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 May 2006 - 10:13 AM

how do i explode the dates fom dates1 to dates4.


$dates1
$dates2
$dates3
$dates4

date format is day month year ("d-m-y")

01-06-2006


example
<?

datbase connection

while 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":
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 May 2006 - 10:46 AM

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:
$date1 = "10-05-206";
list($day, $month, $year) = explode("-", $date1);

echo "date is day $a and month is $b and year is $c";


#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 May 2006 - 10:58 AM

[!--quoteo(post=372873:date=May 10 2006, 10:46 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ May 10 2006, 10:46 AM) View Post[/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:
$date1 = "10-05-206";
list($day, $month, $year) = explode("-", $date1);

echo "date is day $a and month is $b and year is $c";
[/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]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users