title: PHP: equivalent of MySQL's function SUBSTRING_INDEX ?
body: <p>I love the <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index" rel="noreferrer"><code>SUBSTRING_INDEX</code></a> function in MySQL, especially because you can use negative indexes to start searching from the right side of the string.</p>
  
  <p>Is there an equivalent of this function in PHP?  (or an easy way to do it with a bit of code)</p>