Solved

explode ("\n\r", $_GET["email"]); doesn't work

Posted on 2006-11-27
2
331 Views
Last Modified: 2009-12-16
Hi Expert,

The following doesn't work.

$emailadressen=explode ("\n\r", $_GET["email"]);

$_GET["email"] is a text area.
The user can give in multiple e-mail adressen seperate them with line feeds.
The explode function don't work. I've also tried with only "\n" of "\n\r" or "\r\n".
Do I something wrong here?

Regards,

V.R. Jansen
0
Comment
Question by:wanted4u
2 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 125 total points
Comment Utility
Try:

$emailadressen=preg_split("/\r?\n\r?/", $_GET["email"]);

-r-
0
 

Author Comment

by:wanted4u
Comment Utility
Hi Roonaan,

I've make a mistake somewhere else in the program, so I make a wrong conclusion..
$emailadressen=explode ("\r\n", $_GET["email"]); works perfectly, but your solution is maybe safer to use and works also perfect.

Thanks ....
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now