I have file like this
#####
....
....
.....
###one
...
...
...
###two
....
....
#####
I want read from ###one
until ###two
I don't want to read line by line
Just tested, this works perfectly:
preg_match('/###one(.*?)###two/s', $fileContents, $output);
echo $output[1];
Alternative way for consideration but also need to read the entire file:
<?php
$s = file_get_contents('the_file');
$ans = explode('###two', explode('###one', $s, 2)[1], 2)[0];
echo $ans;