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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-01-2009, 03:52 AM   #1
Bird
Confirmed User
 
Bird's Avatar
 
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
Bird is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 04:22 AM   #2
Brujah
Beer Money Baron
 
Brujah's Avatar
 
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;
}
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 04:30 AM   #3
Bird
Confirmed User
 
Bird's Avatar
 
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


Quote:
Originally Posted by Brujah View Post
Not really sure what you're doing, but you want a loop?
Code:
foreach($c as $dt) {
    echo $dt;
}
__________________
ICQ:268731675
Bird is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 05:00 AM   #4
Fredde
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
Fredde is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 05:04 AM   #5
frank7799
Confirmed User
 
frank7799's Avatar
 
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?
frank7799 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 05:18 AM   #6
Brujah
Beer Money Baron
 
Brujah's Avatar
 
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];
}
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 05:21 AM   #7
Bird
Confirmed User
 
Bird's Avatar
 
Join Date: Jan 2005
Location: Stockton
Posts: 4,365
many thanks, I can get what i need from here. It was the for $i count I was looking for ($date[$i] . $time[$i];) it seemed everything else was rewriting the array key.

$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;
}



Quote:
Originally Posted by Fredde View Post
Do a for loop instead!
for($i=0;$i<= $numrecords;$i++)
{
$string = $date[$i] . $time[$i];
}
__________________
ICQ:268731675
Bird is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 05:23 AM   #8
Fredde
Confirmed User
 
Join Date: Mar 2004
Location: Sweden
Posts: 501
You're welcome!
__________________
-------------------------------------------
Teen boobs | Elitecounter - Free counter service
Fredde is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-01-2009, 07:51 AM   #9
Adultnet
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!
Adultnet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.