[PHP] just wanna know

2002-02-28 Thread eoghan

hi

whats the difference between
print and echo ?

thanks

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




Re: [PHP] just wanna know

2002-02-28 Thread Simon Willison

eoghan wrote:

whats the difference between
print and echo ?

 From memory, print() is a function while echo is a language construct 
The major difference is that you can use echo with a comma seperated 
list of arguments, while print requires you to concatenate strings For 
example:

echo hello , world;
print hello world;

Of these two the echo command is more efficient The print statement 
requires PHP to create a new string in memory and copy hello  and 
world into it, then display that string The echo command does not 
require the new string creation step - instead it sends hello  to the 
browser, then sends world to the browser without needing to stick them 
together in memory first

The difference in performance however is minimal to the point of being 
completely un-noticable

I think that's the difference anyway :)

Simon



-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] just wanna know

2002-02-28 Thread Sean Kennedy

As far as the output in the browser there is no differnece between echo  ;
and print( ); .

-Sean
- Original Message -
From: eoghan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 28, 2002 5:17 AM
Subject: [PHP] just wanna know


 hi

 whats the difference between
 print and echo ?

 thanks

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



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