Possible Duplicate:
what is output buffering?
Why does PHP send it all at once?
I want to echo "sent" dynamically when sending emails from list. My script only echos after it finishes all. How can I echo string dynamically in while loop ?
$f=fopen("list.txt","r");
if($f){
    while (!feof($f)) {
        $line = fgets($f, 4096);
        $lncount++;
        $val = $lines[$lncount];
        mailsender($line,$yollayan,$sifresi,$name);
        echo "sent";
    }
}
 
     
     
     
     
     
    