from the manual:
[print is a language construct [EMAIL PROTECTED]]
The print() function returns a boolean indicating the status of the call. If the
write was successful, print() returns 1. If not, it returns 0. This can be used to
detect when the client has closed the connection, and appropriate measures taken. The
builtin echo does not provide this same service.


can anyone else think of any other difference between
print and echo ?

i use print, becuase that's what i'm used to...
but i'd be curious to find out if there really
is any significant differences between the way
echo and print both work.....


> -----Original Message-----
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] echo vs printf
>
>
> i seem to remember reading somewhere that print acts like (is) a function,
> presumably returning false if  it cannot print to screen, whereas echo just
> dumps it.
>
> also you can drop vars in print like
>
> print "you have $points points";
>
> whereas to echo it you'd have to concatenate the string.
>
> Steve
>
>
> "Don Read" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > On 16-Jul-01 brother wrote:
> > > Why should I use printf instead of echo and vice versa?
> > >
> >
> > printf print-formated
> >
> > $a=12.3456;
> >
> > echo $a, '<BR>';
> > printf('%1.2f<BR>', $a);
> >
> > 12.3456<BR>
> > 12.34<BR>
> >
> > > As for today I use printf mostly but I don't know why.
> >
> > You prolly mean print; There may be some minor differences from echo,
> > but i've never seen 'em.
> > (i think they threw print in PHP to keep JAPHs happy).
> >
> > Regards,
> > --
> > Don Read                                       [EMAIL PROTECTED]
> > -- It's always darkest before the dawn. So if you are going to
> >    steal the neighbor's newspaper, that's the time to do it.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to