I have this case :
<!-- [STATIC STRING] -->
Some HTML codes here
<!-- [STATIC STRING END] -->
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 :
<!-- [STATIC STRING] -->
Some HTML codes here
<!-- [STATIC STRING] -->
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?
UPDATE : let’s say that HTML code stored as file.html and on the other side I have this PHP script :
$Filename = 'file.html';
$Handle = fopen($Filename, "r");
$Contents = fread($Handle, filesize($Filename));
fclose($Handle);
from this PHP, I have no clue how to get HTML code between <!-- [STATIC STRING] --> and <!-- [STATIC STRING END] -->. 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.
Use this to extract data from a string