title: Php get specific word in string
body: <p>I have a url. I want to parse url. I don't want to get last two value. How can I do?</p>
  
  <pre><code>$str="first-second-11.1268955-15.542383564";
  </code></pre>
  
  <p>As I wanted </p>
  
  <pre><code>$str="first-second";
  </code></pre>
  
  <p>I used this code. But I don't want to get <code>-</code> from last value</p>
  
  <pre><code>$arr = explode("-", $str);
  for ($a = 0; $a &lt; count($arr) - 2; $a++) {                
      $reqPage .= $arr[$a] . "-";       
  }
  </code></pre>