title: PHP : How To Get Strings Between 2 Static Strings?
body: <p>I have this case :</p>
  
  <pre><code>&lt;!-- [STATIC STRING] --&gt;
  Some HTML codes here
  &lt;!-- [STATIC STRING END] --&gt;
  </code></pre>
  
  <p>How to get that any codes between STATIC STRING and STATIC STRING END in PHP? Is it possible to get something in between same condition like this :</p>
  
  <pre><code>&lt;!-- [STATIC STRING] --&gt;
  Some HTML codes here
  &lt;!-- [STATIC STRING] --&gt;
  </code></pre>
  
  <p>I just need to put some string between something so later on I can manipulate it using PHP. Any idea how to make it efficient?</p>
  
  <p><strong>UPDATE</strong> : let's say that HTML code stored as file.html and on the other side I have this PHP script :</p>
  
  <pre><code>$Filename = 'file.html';
  $Handle = fopen($Filename, "r");
  $Contents = fread($Handle, filesize($Filename));
  fclose($Handle);
  </code></pre>
  
  <p>from this PHP, I have no clue how to get HTML code between <code>&lt;!-- [STATIC STRING] --&gt;</code> and <code>&lt;!-- [STATIC STRING END] --&gt;</code>. and to make it simpler... just assume that there are no other codes before and after it. what I need is the code between those two and put it as PHP variable.</p>