I'm sorry, I should have been more clear in my first post.
I need to read a file up to a point, and then read the rest of the file:
<html>
<body>
<!-- read until here -->
TEXT
<!-- read after here -->
</body>
</html>
I need to read up until <!-- read until here -->, then read everything after <!-- read after here -->. Should this not work:
<?php
$readthefile = file("file.html");
$c = count($readthefile);
$topkeys = array_search("<!-- edit flag start -->", $readthefile);
$botkeys = array_search("<!-- edit flag end -->", $readthefile);
for ($i=0;$i<$topkeys;$i++) {
$top .= $readthefile[$i];
}
for ($i=$botkeys;$i<$c;$i++) {
$bottom .= $readthefile[$i];
}
echo $top;
echo "text to insert between values";
echo $bottom;
?>
Note that I don't want to use a require() or include() function for certain reasons.