PHP: print - Manual in Deutsh
PHP: print - Manual in French
PHP: print - Manual in Polish

You Are At PHP: print - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

print

(PHP 3, PHP 4, PHP 5)

print -- Output a string

Description

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.

Example 1. print() examples

<?php
print("Hello World");

print
"print() also works without parentheses.";

print
"This spans
multiple lines. The newlines will be
output as well"
;

print
"This spans\nmultiple lines. The newlines will be\noutput as well.";

print
"escaping characters is done \"Like this\".";

// You can use variables inside of a print statement
$foo = "foobar";
$bar = "barbaz";

print
"foo is $foo"; // foo is foobar

// You can also use arrays
$bar = array("value" => "foo");

print
"this is {$bar['value']} !"; // this is foo !

// Using single quotes will print the variable name, not the value
print 'foo is $foo'; // foo is $foo

// If you are not using any other characters, you can just print variables
print $foo;          // foobar

print <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
?>

For a short discussion about the differences between print() and echo(), see this FAQTs Knowledge Base Article: http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

Note: Because this is a language construct and not a function, it cannot be called using variable functions

See also echo(), printf(), and flush().

oprogramowanie magazynowe
Najtańszy fotograf lublin na ślub
kody kreskowe paskowe RFID Czytniki mobilne drukarki etykiet termina
Pozycjonowanie stron
Dostawca kas fiskalnych w Białymstoku

Another Useful functions:


zend.printing | zend-api.zend-print-zval | zend-api.zend-print-zval-r | zend-api.zend-print-zval-r-ex | zend-api.zend-print-zval-ex | zend-api.zend-print-variable | zend-api.zend-print-flat-zval-r | zend-api.zend-make-printable-zval | ref.printer | function.vsprintf | function.vprintf | function.vfprintf | function.ssh2-fingerprint | function.sprintf | function.snmp-set-quick-print | function.snmp-set-oid-numeric-print | function.snmp-set-enum-print | function.snmp-get-quick-print | function.quoted-printable-decode | function.ps-setoverprintmode | function.printf | function.printer-write | function.printer-start-page | function.printer-start-doc | function.printer-set-option | function.printer-select-pen | function.printer-select-font | function.printer-select-brush | function.printer-open | function.printer-logical-fontheight | function.printer-list | function.printer-get-option | function.printer-end-page | function.printer-end-doc | function.printer-draw-text | function.printer-draw-roundrect | function.printer-draw-rectangle | function.printer-draw-pie | function.printer-draw-line | function.printer-draw-elipse | function.printer-draw-chord | function.printer-draw-bmp | function.printer-delete-pen | function.printer-delete-font | function.printer-delete-dc | function.printer-delete-brush | function.printer-create-pen | function.printer-create-font | function.printer-create-dc | function.printer-create-brush | function.printer-close | function.printer-abort | function.print | function.print-r | function.imap-qprint | function.fprintf | function.debug-print-backtrace | function.ctype-print | function.com-print-typeinfo |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.