title: Get content between two strings PHP
body: <p>Whats is the best way to obtain the content between two strings e.g.</p>
  
  <pre><code>ob_start();
  include('externalfile.html'); ## see below
  $out = ob_get_contents();
  ob_end_clean();
  
  preg_match('/{FINDME}(.|\n*)+{\/FINDME}/',$out,$matches);
  $match = $matches[0];
  
  echo $match;
  
  ## I have used .|\n* as it needs to check for new lines. Is this correct?
  
  ## externalfile.html
  
  {FINDME}
  Text Here
  {/FINDME}
  </code></pre>
  
  <p>For some reason this appears to work on one place in my code and not another. Am I going about this in the right way? Or is there a better way?</p>
  
  <p>Also is output buffer the way to do this or file_get_contents?</p>
  
  <p>Thanks in advance!</p>