Hi,
The sequence is like this:
$fp = fopen("www.someplace.com/a.php", "r");
$content = fread($fp, 256); // ommit the while loop here for whole stream
then write this $content to a local file in web server using fwrite(). suppose file name is a.txt.
then read the $content again from the same url as step 1.
read file content of a.txt to $local_content. using fread();
then I have two string variables: $content and $local_content.
- the result of ($content == $local_content) is false, which is obviously not what I want. The two variables should hold the same value.
I am sure there is no coding error regarding file reading and url remote reading.
I guess the os did something to the string when write to file.
Can anyone tell where the problem is?