title: PHP Ternary Expression / If Statement
body: <p>I'm learning ternary expressions in PHP and was wondering if someone could verify that the following two blocks of code are the same as far as what is the outcome?</p>
  
  <pre><code>$caption = $_POST['caption'] == '' ? NULL : $_POST['caption'];
  </code></pre>
  
  <p>Is the above the same as the below?</p>
  
  <pre><code>if ( $_POST['caption'] == '' ) {
      $caption = NULL;
  }
  else {
      $caption = $_POST['caption'];
  }
  </code></pre>