Hello people! Im new here. Im on a deadline. I need your help about fread. Here's the scenario: Im reading a textfile with emails on it (one email per line) and i've already parsed it. I already opened the $handle which is $myspace_search_url = "http://search.myspace.com/index.cfm?fuseaction=find.search&searchType=network&interesttype=&country=&searchBy=Email&f_first_name=mark143rlc@yahoo.com&Submit=Find&SearchBoxID=FindAFriend"; $handle_url = fopen("$myspace_search_url", "rb"); while (!feof($handle_url)) { $contents_url .= fread($handle_url, 8192); } That is already working but in the inputted text file contains for example 3 email addresses. I made a for loop to read all of the emails in the text file. $contents = file($filename); $contents_count = count($contents); for($x=0; $x<$contents_count; $x++){ $myspace_search_url = "http://search.myspace.com/index.cfm?fuseaction=find.search&searchType=network&interesttype=&country=&searchBy=Email&f_first_name=".$contents[$x]."&Submit=Find&SearchBoxID=FindAFriend"; $handle_url = fopen("$myspace_search_url", "rb"); while (!feof($handle_url)) { $contents_url .= fread($handle_url, 8192); } if (strpos($contents_url, "We weren't able to find a") != 0) { // the email has no myspace account echo "THE EMAIL ADD $contents[$x] HAS NO MYSPACE ACCOUNT!!!<br>"; $valid = true; } else if (strpos($contents_url, "We weren't able to find a") == 0) { // the email has a myspace account echo "THE EMAIL ADD $contents[$x] HAS A MYSPACE ACCOUNT!!!<br>"; $valid = false; } fclose($handle_url); } // end of for loop The problem is if you put it inside a for loop, the $contents_url concatenates so the strpos will be confused in finding the "We weren't able to find a". For example the first email has a myspace acct, the strpos will not find the "We weren't able to find a" string so $valid will return true. In the second loop, it will parse the next email in the text file that is not valid so that it will return false. BUT the problem is the $contents_url now contains two values because of the concatenation. It will find a "We weren't able to find a" AND it will not find "We weren't able to find a" so my validation will not work. Is there any other way for this ---> while (!feof($handle_url)) { $contents_url .= fread($handle_url, 8192); } I mean if in the first loop I will put the contents to a different variable and in the second loop I will put the second content to a different variable? By the way, I have tried this inside the for loop but this is not working ---> while (!feof($handle_url)) { $contents_url .= fread($handle_url, 8192); $contents_url_array[$ctr] = $contents_url; array_push($contents_url_array, $contents_url); } The var_dump($contents_url_array) will output one index(0) with a value of (the concatenated search output which is wrong).......I have 3 loops that will happen in my for loop Is there a way I can put this in my array? ---> array(3) { [0]=> "valid_email" [1]=> "not_valid_email" [2]=> "valid_email" } The text file I have contains 3 email addresses. mark143rlc@yahoo.com <--- this is VALID (Valid = this email has a myspace acct.) not_valid@gmail_yahoo.com <--- this is NOT VALID marknt15@gmail.com <--- this is VALID That is all thank you very much! Please help. Thanks in advance. God Bless.