quick question:
So I've written a bunch of crawling code, but one of the websites I'm crawling didn't include line breaks between tags. Since I've already written a bunch of code, I threw in a quick hack with preg_replace and continued from where I left off. Problem is, fopen() doesn't work on strings...
$string = file_get_contents($url);
$string = preg_replace("/>(^\n|\n+)?</", ">\n<", $string);
$file = fopen($string, 'r');
while(($buffer = fgets($file)) != false) { ... }
So, without rewriting my loop, how do I approach this?
Thanks for the help!
Rob