print или echo?

mutex

Guest
print или echo?

Давно мучал этот вопрос - в чем разница? Какую функцию лучше использовать? Или они идентичны?
 

Winer

Мимо проходил
Output one or more strings (PHP 3, PHP 4 )
void echo ( string arg1 [, string argn...] )
Outputs all parameters.
echo() is not actually a function (it is a language construct) so you are not required to use parentheses with it. In fact, if you want to pass more than one parameter to echo, you must not enclose the parameters within parentheses.

Output a string (PHP 3, PHP 4 )
int print ( string arg )
Outputs arg. Returns 1, always.
print() is not actually a real function (it is a language construct) so you are not required to use parentheses with its argument list.

вот и вся разница :)
 
Сверху