title: PHP substr after a certain char, a substr + strpos elegant solution?
body: <p>let's say I want to return all chars after some needle char <code>'x'</code> from: </p>
  
  <p><code>$source_str = "Tuex helo babe"</code>.</p>
  
  <p>Normally I would do this:</p>
  
  <pre><code>if( ($x_pos = strpos($source_str, 'x')) !== FALSE )
     $source_str = substr($source_str, $x_pos + 1);
  </code></pre>
  
  <p><strong>Do you know a better/smarter (more elegant way) to do this?</strong></p>
  
  <p>Without using regexp that would not make it more elegant and probably also slower.</p>
  
  <p>Unfortunately we can not do:</p>
  
  <pre><code>$source_str = substr(source_str, strpos(source_str, 'x') + 1);
  </code></pre>
  
  <p>Because when <code>'x'</code> is not found <code>strpos</code> returns <code>FALSE</code> (and not <code>-1</code> like in JS).
  <code>FALSE</code> would evaluate to zero, and 1st char would be always cut off.</p>
  
  <p>Thanks,</p>