title: PHP how to retrieve string at the end with substr and strrpos
body: <p>I have this string abc_123_test and I am trying to get just "test" from the string.  I have this code currently.</p>
  
  <pre><code>$string = 'abc_123_test';
  
  $extracted_string = substr( $string, 0, strrpos( $string, '_' ) );
  </code></pre>
  
  <p>However this gets the first part of the string, everything up to 'abc_123'.  So it seems it is reverse of what I wanted.  I thought by using strrpos, it will get the reversed but obviously I am missing something.</p>
  
  <p>Any help?</p>