Please read the manual on what file() does.

www.php.net/file

It reads a file and assigns each line of it to an array. So $Emails will
be an array with each line of "emails.txt" in an element.

So, to see how many elements you have, you count() them.

$num_emails = count($Emails);
for($Cnt=0;$Cnt<$num_emails;$Cnt++)


---John Holmes...

> -----Original Message-----
> From: Rodrigo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 29, 2002 7:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to findout if the file is over
> 
> I've got the following problem:
> 
> I'm trying to send a number of messages to a certain number of
e-mails,
> the e-mails are writen in a text file and I need to findout when the
> file is over.
> 
> The sample code is under this line , if someone can help me, I'd
> apreciate it.
> 
> <?php
> 
>     $Emails = File('emails.txt');
>     $Remetente = "Nome do remetente <[EMAIL PROTECTED]>";
>     $Assunto = "Assunto do E-mail";
>     $Mensagem = $Anuncio;
>     For ($Cont=0; $Cont != feof; $Cont++)
>         {
>             $Destino = $Emails[$Cont];
>             mail($Destino,"Assunto",$Mensagem,"From: $Remetente\n");
>         }
> ?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to