hi
I want to be able to read a particular file, say file.html for example, and search code to see if there is a comment that begins with "<!--C", and if there is, save the text between the "<!--C" and the "-->" then output it.
i've been having a play on with no success! I've tried strstr(), preg_match() functions.
am i right to use the following code to read the code?
$fileread = "file.html";
$fd = fopen ("$fileread", "r+");
while (!feof ($fd)) {
$buffer = fgetc($fd);
}
fclose ($fd);
or is there a better way to do it?
so just to recap, if in a html page there was one line of code that said
<!--C This is a comment -->
I'd want "This is a comment" to be outputted.
if anyone can help, that'd be great. cheers