I'm trying to loop through some POST data and write it to a file, but I'm having some trouble figuring out the array... The HTML elements are names "eastern_1_day1" "pacific_1_day1" "eastern_2_day1" "pacific_2_day1"...etc
$i = 1;
while( $east = $_POST['eastern_'.$i.'_day1'] && $pac = $_POST['pacific_'.$i.'_day1'] && $title = $_POST['title_'.$i.'_day1'] ){
//Day 1
$show = '<li>'."\n";
$show .= '<div class="time">'.$east.' Eastern /<br>'.$pac.' Pacific</div>'."\n";
$show .= '<div class="item">'."\n";
$show .= '<a class="title">'.$title.'</a>'."\n";
$show .= '<span class="descrip"> Last "ONES" to Own-Late Night Edition: Extremely fast games with quantities of ONE from our Vault!</span>'."\n";
$show .= '</div>'."\n";
$show .= '</li>'."\n";
fwrite($file_handle, $show);
$i++;
}
The output is...
#
1 Eastern /
1 Pacific
Auctions Last "ONES" to Own-Late Night Edition: Extremely fast games with quantities of ONE from our Vault!
#
1 Eastern /
1 Pacific
Late Night Last "ONES" to Own-Late Night Edition: Extremely fast games with quantities of ONE from our Vault!
instead of...
#
6:00PM Eastern /
3:00PM Pacific
Auctions Last "ONES" to Own-Late Night Edition: Extremely fast games with quantities of ONE from our Vault!
#
7:00PM Eastern /
4:00PM Pacific
Late Night Last "ONES" to Own-Late Night Edition: Extremely fast games with quantities of ONE from our Vault!
My array prints like this...
Array ( [day1_date] => Friday, August 15, 2008 [eastern_1_day1] => 6:00PM [pacific_1_day1] => 3:00PM [title_1_day1] => Auctions [eastern_2_day1] => 7:00PM [pacific_2_day1] => 4:00PM [title_2_day1] => Late Night