I need some help with this code. I am pretty sure the code is correct but I could be wrong. The problem is that the getSourceCode() isn’t pulling the entire contents of the URL. It only returns a third of the data, for example: the $size variable would return 26301 and the returned data size would only be 8900. I have changed php.ini to have max file size of 100M so I don’t think that is problem.
private function getSourceCode($url){
$fp = fopen($url, "r");
$size = strlen(file_get_contents($url));;
$data = fread($fp, $size);
fclose($fp);
return $data;
}
Ok, well, if you’re using
file_get_contentsyou shouldn’t be using fread too.