title: code in elseif block partially running when it shouldn't
body: <p>Ok, I have a registration form for my site.</p>
  
  <p>When there are errors up pops a box with the errors. The box is made up of an html div, an h2 header, and php echoing my errors.</p>
  
  <p>If I hit submit it shows the errors like it should, but the header and div show up no matter what.</p>
  
  <p>I dont understand why.</p>
  
  <p>Here is the code block that echoes the errors.</p>
  
  <pre><code>} else if (!empty($errors)){
      echo '&lt;div class="msg_module"&gt;';
      echo '&lt;h2&gt;Registration Errors:&lt;/h2&gt;';
      echo $General-&gt;outputErrors($errors);
      echo '&lt;/div&gt;';
  }
  </code></pre>
  
  <p>Thanks all!</p>
  
  <p>Edit: I should mention that $errors is an array.</p>
  
  <p>EDIT: My internet is back, here is the outputErrors function:</p>
  
  <pre><code>public function outputErrors($errors = ''){
  
          if(is_array($errors)){
              // handle for passed array
              foreach ($errors as $error){
                  if(is_array($error)){
                      general::outputErrors($error);
                  } else{
                  general::$errStr.= ($error != '')?'&lt;li&gt;'.$error.'&lt;/li&gt;':'';
                  }
              }
          } else if($errors != ''){
          // handle for passed string
          general::$errStr = $errors;
          }
      return '&lt;ul id="error_list"&gt;'.general::$errStr.'&lt;/ul&gt;';
   }//outputErrors
  </code></pre>