I'm using the following code in an attempt to read the results of an online seach and echo just the first 10 characters of each line:
$searchstring "http://www.someurl.com?search=data";
$results = fopen($searchstring,"r");
while (!feof ($results)) {
$line = fread($results, 4096);
$echo substr($line, 0, 10);
}
In all of my attempts I have been unable to alter the string returned in $line. I know I'm missing a step between fopen and echo, but I can't figure out what. I've been stumped on this for hours.
Any help?