Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 46



Учебник РНР
НазадВперёд

print

(unknown)

print - выводит строку.

Описание

print (string arg)

Выводит arg. Возвращает TRUE при успехе, FALSE при неудаче.

print() это в действительности не функция (а конструкция языка), поэтому с ней не обязательно использовать скобки. Но print(), в отличие от echo(), может вызываться с использованием функции переменной.

Пример 1. print()
<?php
print("Hello World");

print "print() работает также без скобок.";

print "Это захватывает
несколько строчек. Символы newline также
будут выведены";

print "Это захватывает\nнесколько строчек. Символы newline будут также\nвыведены.";

print "мнемонизация символов выполняется \"Как здесь\".";

// Вы можете использовать переменные внутри оператора print
$foo = "foobar";
$bar = "barbaz";

print "foo is $foo"; // foo это foobar

// Использование одинарных кавычек напечатает имя переменной, а не её значение
print 'foo is $foo'; // foo это $foo

// Если вы не используете другие символы, вы можете просто печатать переменные
print $foo;          // foobar

print <<<END
Это используется синтаксис "here document" для вывода нескольких строчек
с интерполяцией $variable. Обратите внимание на то, что
терминатор here document обязан появиться в строчке
с последующей точкой с запятой без разделения пробелом!
END;
?>

См. также echo(), printf() и flush().


Назад Оглавление Вперёд
parse_str Вверхprintf


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 173

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 173

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 299

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/print.html on line 299