Re: split() - not working in this case
| From: | Chris Wesley | Date: | Sun, 08 Sep 2002 09:03:32 +0000 |
| Subject: | Re: split() - not working in this case | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115647@lists.php.net to get a copy of this message | ||
On Sun, 8 Sep 2002, N. Pari Purna Chand wrote:
> $to = " abcd <abcd@asd.net>, efgh <xxx@xxx.com>" ;
> Now split() in the following function*** is notworking as needed.
> ie, I'm getting
> $tos[0] = "abcd";
> $tos[1] = "efgh";
split didn't do anything wrong. use your browser's "view source" to see
the desired output. funny things, those less-than & greater-than
characters ... they make browsers think you've created an HTML tag!
Two things you can do to make displaying such data in a browser:
1) if you're trying to display text that has HTML entities in it,
within a HTML page, use the htmlentities() function when
printing output. http://www.php.net/htmlentities
2) if you don't care about HTML at all, send a Content-type header that
tells the browser what you're sending is text.
header( "Content-type: text/plain" );
g.luck,
~Chris