获得解析错误:语法错误,意外'}',期待','或'; [关闭]

Here is my code. I'm new to php and just trying to edit a page using Kompozer. When I published the site back to the ftp server this error suddenly appeared on the page. Odd since I didn't even touch this code. (I have since touched the below code trying to fix it). Any help fixing this code would be much appreciated.

   <?php 
     if(isset($_SESSION["pkg_error"]))
   ?>
      <div class="error_msg_cont">
    <?php 
    foreach($_SESSION["pkg_error"] as $error)
    {
    echo $error. "<br>"
    }
    ?></div>
    <?php 
    if(isset($_SESSION["msg"]))
    {
    echo '<div class="error_msg_cont">'. $_SESSION["msg"] .'<div>'
    }
    ?>

On these two lines:

echo $error. "<br>" }

echo '<div class="error_msg_cont">'. $_SESSION["msg"] .'<div>' }

You need a semicolon before the closing }.

Closing a PHP code block (?>) implies a semicolon, but closing a block of code within a PHP code block (}) does not.

you missed ; on :

echo $error. "<br>" }

and

echo '<div class="error_msg_cont">'. $_SESSION["msg"] .'<div>' }

Actually, the error is self-explained.