Re: [PHP] split() - not working in this case

2002-09-08 Thread N. Pari Purna Chand

Yeah,
I have outputted to browser

Split() was working fine.. Sorry for the noise
on the list. But I have realised that the very moment
I posted the mail on the list.

/Chandu


- Original Message - 
From: "Chris Wesley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "N. Pari Purna Chand" <[EMAIL PROTECTED]>
Sent: Sunday, September 08, 2002 2:33 PM
Subject: Re: [PHP] split() - not working in this case


> On Sun, 8 Sep 2002, N. Pari Purna Chand wrote:
> 
> > $to = " abcd <[EMAIL PROTECTED]>, efgh <[EMAIL PROTECTED]>" ;
> 
> > 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
> 
> 
> 
> 
> 


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




Re: [PHP] split() - not working in this case

2002-09-08 Thread Chris Wesley

On Sun, 8 Sep 2002, N. Pari Purna Chand wrote:

> $to = " abcd <[EMAIL PROTECTED]>, efgh <[EMAIL PROTECTED]>" ;

> 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





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




Re: [PHP] split() - not working in this case

2002-09-08 Thread Bas Jobsen

, efgh <[EMAIL PROTECTED]>";
$tos=split_addresses($to);
echo $tos[1];
?>

echos efgh <[EMAIL PROTECTED]> ?? Whats the problem? Maybe you output to a browser 
and don't see <[EMAIL PROTECTED]> cause its between <>



Op zondag 08 september 2002 10:17, schreef N. Pari Purna Chand:
> I have a string
> $to = " abcd <[EMAIL PROTECTED]>, efgh <[EMAIL PROTECTED]>" ;
>
> I want a function returning an array of
> indivial names+mailids like from the $to seperated by ","
> something like
> $tos[0] = "abcd <[EMAIL PROTECTED]>";
> $tos[1] = "efgh <[EMAIL PROTECTED]>";
>
> Now split() in the following function*** is notworking as needed.
> ie, I'm getting
> $tos[0] = "abcd";
> $tos[1] = "efgh";
>
> Not the complete name + ,
> Why ?
> /Chandu
>
> ***
> function split_addresses($addr) {
>  $ad = array();
>  $ad = split(",",$addr);
> return $ad;
> }

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