Jake McHenry wrote:

Is this possible? I've been messing with this for about an hour now,
searching on google for about half hour. Here is what I want to do:

foreach ($array as $key => $value)
{
  $value = explode("|", $value);
  $counter = 0;

  if ($value[7] == "Yes")
  {
    $counter++;
    $date_$counter = $value[1];      <-- this is line 33
$date[$counter] = $value[1];
$dest_$counter = $value[3];
$dest[$counter] = $value[3];
$dep_$counter = $value[4];
$dep[$counter] = $value[4];
  }
}

Then later, I would like to do:

for ($i = 0; $i < $counter; $i++)
{
  echo "$date_$i, $dest_$i, $dep_$i<br>\n";
echo "$date[$i], $dest[$i], $dep[$i]<br>\n";
}


But, I get an error: Parse error: parse error, unexpected T_VARIABLE in /var/www/secure/travelrequest/travel7.php on line 33

Is there a way I can do this?

Thanks,

Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to