<?php  
    if(count($error)>0){
?>
    <div class="msg error">
        <?php foreach($error as $error):?>
            <li><?php echo $error;?></li>
        <?php endforeach;?>
    </div>
<?php
    }
?>