-1

Im trying to echo the content of the foreach loop inside div tag but I get an error message. I know my making a mistake in concatenating html and php but Im not sure where I'm making the mistake. Can some one point me in the right direction?

<php
  for($i=0; $i<$daysInTheMonth; $i++){
   if($i==$firstDayOfMonth)
     $BeginMonth= true;

    if($BeginMonth){
   $CounterForDays++;

    echo  "<div class=dateContainner> ".$CounterForDays <br/> ;
    foreach ($_POST['mondayTime'] as $Times ){
     echo  "$Times <br>" ;
   }
     ."</div>";
 }
    else
  echo "<div class=dateContainner>  </div>";
}
 ?> 
Joe Segway
  • 3
  • 1
  • 4

1 Answers1

0

Use this code

if($BeginMonth){
  $CounterForDays++;
  echo  "<div class=dateContainner> ".$CounterForDays." <br/>" ;
  foreach ($_POST['mondayTime'] as $Times ){
   echo  $Times."<br>" ;
  }
  echo "</div>";
} 
Ravinder Reddy
  • 3,869
  • 1
  • 13
  • 22
  • I see what I did. Thanks. If I want to add this: echo " ".$Times."
    " ; do I have to open an re open a line inside the quation marks?
    – Joe Segway Mar 27 '17 at 15:39