Let’s consider that there is a text file called 1.txt which has the following content.
wow<br>wow<br>wow<!--Read More--><br>wow<br>wow<br>wow<br>wow<br>wow<br>wow<br>
I want to display its contents only upto the <!--Read More-->
Presently am using fopen command to read and display whole text file.
$file_handle = fopen("posts/1.txt", "r");
while (!feof($file_handle)) {
$line_of_text = fgets($file_handle);
print $line_of_text;
}
Kindly someone help me with this…
1 Answer