Forum Moderators: coopster
I have a users.php file that contains all my user details. Each line is for each customer. Each customer also has a email address, i want to fetch all the email addresses and store it as a variable so that i can use it in the BCC field of a form2mail. Can anyone please help me out.
The email address is not the first value on each line. The first value is username, then password, then access level, then the email address. However, the email address starts straight after the following:
<del>0<del>
and it ends with a <del>
so a email address will look like this:
<del>0<del>me@mydomain.com<del>
and then it continues with other values.
can anyone please tell me how i can do this.
Many thanx in advanced.
Laura
1. open the file [ca.php.net]
2. use a while loop [ca.php.net] to read a line from the file using fgets [ca.php.net]
3. use split [ca.php.net] or preg_split [ca.php.net] to chop the lines on '<del>'
4. from the resulting array grab the appropriate value and drop it into your email list or var
output it to somewhere, file, screen, whatever. Then keep the script for next time.
But it sounds a bit complicated, can anyone simplify it further, i've got a form2mail script ready i just need to take the email addresses out and store them into a variable seperated by commas.
Many thanx in advanced.
Warning: Wrong parameter count for fgets()
Any ideas?
Thanx