title: PHP if shorthand
body: <p>I have a string that I want to append it some other string. let's say:</p>
  <pre><code>$my_string = 'Hello';
  
  $my_string .= ' there';
  </code></pre>
  <p>this would return 'Hello there'.</p>
  <p>I want to make this conditional like this:</p>
  <pre><code>$my_string = 'Hello';
  
  $append = 'do';
  
  if ( $append == 'do' ) {
  
      $my_string .= ' there';
  
  }
  </code></pre>
  <p>Now, I want to use a ternary operation to do this, but all the examples I came across are for if/else which will be something like:</p>
  <pre><code>$my_string .= ( $append == 'do' ) ? ' there' : '';
  </code></pre>
  <p>so is it possible to do it with only IF and without else?</p>