![]() |
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 ) |
Not really sure what you're doing, but you want a loop?
Code:
foreach($c as $dt) { |
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:
|
Do a for loop instead!
for($i=0;$i<= $numrecords;$i++) { $string = $date[$i] . $time[$i]; } |
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? |
building $c array from $a and $b arrays? maybe:
Code:
$c = array(); |
:thumbsup:thumbsup:thumbsup 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:
|
You're welcome!
|
you are very much welcome :)
|
All times are GMT -7. The time now is 03:14 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123