robert_gsfame Posted September 1, 2009 Share Posted September 1, 2009 <?php $day = $_POST['day']; ------------->09 $month = $_POST['month']; ---------->02 $year = $_POST['year'];--------------->2009 $num= "/".$day."/".$month."/".$year; ---->09/02/2009 //echo $num; explode("/",$num); echo $num[0]; echo $num[1]; echo $num[2]; ?> can anyone help me how to get result like this "9022009" Link to comment https://forums.phpfreaks.com/topic/172668-solved-explode-simple-question/ Share on other sites More sharing options...
robert_gsfame Posted September 1, 2009 Author Share Posted September 1, 2009 sorry wrong typed Link to comment https://forums.phpfreaks.com/topic/172668-solved-explode-simple-question/#findComment-910130 Share on other sites More sharing options...
ignace Posted September 1, 2009 Share Posted September 1, 2009 $num= "/".$day."/".$month."/".$year; ---->09/02/2009 Is $num= "/".$day."/".$month."/".$year; ---->/09/02/2009 Then: explode("/",$num); Should be: $num = explode("/",$num);//returns Array ( [0] => , [1] => 09, [2] => 02, [3] => 2009); Remove the leading forward slash: $num= $day."/".$month."/".$year; ---->09/02/2009 And you'll get: $num = explode("/",$num);//returns Array ( [0] => 09, [1] => 02, [2] => 2009); Link to comment https://forums.phpfreaks.com/topic/172668-solved-explode-simple-question/#findComment-910132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.