title: How to get substring of string using starting and ending character in PHP?
body: <p>I am looking for finding middle part of a string using starting tag and ending tag in <strong>PHP</strong>.</p>
  
  <pre><code>$str = 'Abc/hello@gmail.com/1267890(A-29)';
  $agcodedup = substr($str, '(', -1);
  $agcode = substr($agcodedup, 1);
  </code></pre>
  
  <p>final expected value of <code>agcode</code>:</p>
  
  <pre><code>$agcode = 'A-29';
  </code></pre>