title: How to exit if statement and continue to else
body: <p>This is a long shot question, but is there a way in php to exit an "if" statement and continue on to the "else" statement if an error occurs inside the if block?</p>
  
  <p>example</p>
  
  <pre><code>if ($condition == "good")
  {
  //do method one
  
  //error occurs during method one, need to exit and continue to else 
  
  }
  
  else 
  {
  //do method two
  }
  </code></pre>
  
  <p>Of course it is possible to do a nested if inside the first if, but that seems hacky.</p>
  
  <p>TIA</p>