how to separat the emails that i have ?? |
[eluser]frrose[/eluser]
hi all ! i want to ask if I have many Email like this exo@yahoo.com;[email protected];[email protected];[email protected] and i want to insert it in database but each email is alone in one record how ?? and i want it to be in form to use it any time i want thanks ..
[eluser]gyo[/eluser]
Code: $emails_string = "[email protected];[email protected];[email protected];[email protected]"; Then you just have to loop through $emails_array and insert each item into the database. Btw... are you sure that you're not going to send spam?
[eluser]frrose[/eluser]
No i won't but Grad Student lets say that we have an wrong email on it ? or some of this emails dont have ; or if tehy change the ; in new line then how ??
[eluser]Thorpe Obazee[/eluser]
o.o huh? maybe you can explain the situation?
[eluser]gyo[/eluser]
To check the email addresses you can use the valid_email function. For the second problem you should define a separator and stuck with it; if this is not possible then you can do some regular expression to search for *@*.* where the asterisks are the user, the domain and the extension. Basically you want to search for [email protected] Hope that helps. gyo
[eluser]frrose[/eluser]
sorry suashi .. but i didnt understand how to solve the second problem :blank: could you give me an example if you dont mind
[eluser]gyo[/eluser]
I just found something that you could use: Code: <?php $emails will be the array containing all the addresses, so you can go through it with a loop.
[eluser]gyo[/eluser]
No problem, I only hope you'll not make an email spider!
|
Welcome Guest, Not a member yet? Register Sign In |