I saved strlen into $MAX_FILESIZE which was getting value and
The $test was file name saved before this piece of code.
If you please know How to read complete file Instead of reading a hardcoded #. Please let me now.
Thanks.
My code is now working. It reads a file and echo part of the file which is maked for display purpose. My files are not bigger than 15000 chracters.
It is like this, If anyone needs it in future.
$root defined earliar.
$filename=$root . $content;
$acontent="";
if(!$fp = fopen("$filename", "r")){
echo ("Could Not open File");
}
else {
echo("file open");
}
$acontent = fread($fp,15000);
// echo ($acontent);
fclose($fp);
flush();
if (strstr($acontent,'<!-- START ARTICLE -->')) {
echo "" ;
} else {
echo "Substring not found." ;
}
$place1=strpos($acontent, "<!-- START ARTICLE -->");
$place2=strpos($acontent, "<!-- END ARTICLE -->");
$art=substr($acontent, $place1, $place2-$place1);
echo ($art);