title: indexOf and lastIndexOf in PHP?
body: <p>In Java, we can use <code>indexOf</code> and <code>lastIndexOf</code>. Since those functions don't exist in PHP, what would be the PHP equivalent of this Java code?</p>
  
  <pre><code>if(req_type.equals("RMT"))
      pt_password = message.substring(message.indexOf("-")+1);
  else 
      pt_password = message.substring(message.indexOf("-")+1,message.lastIndexOf("-"));
  </code></pre>