![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
|
any php studs arround
I have been spending houre on this and I can t come up with a solution. I have added a time and date form to one of my sites for an alert count down where the user sets up a countdown to an event. The form results are like this. I cant figure out the loop statement can someone help.
Code:
$a = array ( [0] => date1 ,[1] => date2 ,[2] => date3 ) $b array ( [0] => time1 ,[1] => time2 ,[2] => time3 ) $c = array ( [0] =>date1 time1 ,[1] =>date2 time2 ,[2] =>date3 time3 ) //new combined array looking for the output like this 2009-05-15 23:59:59 date1 time1 date2 time2 date3 time3
__________________
ICQ:268731675 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Not really sure what you're doing, but you want a loop?
Code:
foreach($c as $dt) { echo $dt; }
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
|
I got the loop for $c but it's the loop through $a and $b i need to get the combined $c= date time
__________________
ICQ:268731675 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Mar 2004
Location: Sweden
Posts: 501
|
Do a for loop instead!
for($i=0;$i<= $numrecords;$i++) { $string = $date[$i] . $time[$i]; }
__________________
------------------------------------------- Teen boobs | Elitecounter - Free counter service |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Location: In the middle of nowhere...
Posts: 1,974
|
Try it with array_merge and a loop:
$array1 = array("color" => "red", 2, 4); $array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4); $result = array_merge($array1, $array2); Maybe that´s what you are looking for? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
building $c array from $a and $b arrays? maybe:
Code:
$c = array(); while( list($key,$value) = each($a) ) { $c[] = $a[$key].' '.$b[$key]; }
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
|
![]() ![]() ![]() $a = array (date1,date2,date3 ) ; $b = array (time1,time2, time3 ) ; for($i=0;$i<= count($a);$i++) { $string = $a[$i] ." ". $b[$i]."<br>"; echo $string; }
__________________
ICQ:268731675 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Mar 2004
Location: Sweden
Posts: 501
|
You're welcome!
__________________
------------------------------------------- Teen boobs | Elitecounter - Free counter service |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Sep 2003
Posts: 8,713
|
you are very much welcome
![]()
__________________
![]() TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours! |
![]() |
![]() ![]() ![]() ![]() ![]() |