mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
print: &return.success;, add examples
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@65056 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e089e47511
commit
3d837f707e
1 changed files with 42 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.137 $ -->
|
||||
<!-- $Revision: 1.138 $ -->
|
||||
<reference id="ref.strings">
|
||||
<title>String functions</title>
|
||||
<titleabbrev>Strings</titleabbrev>
|
||||
|
@ -1741,10 +1741,49 @@ echo $second[1]; /* prints "another" */
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<simpara>
|
||||
Outputs <parameter>arg</parameter>.
|
||||
Outputs <parameter>arg</parameter>. &return.success;
|
||||
</simpara>
|
||||
<example>
|
||||
<title><function>print</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?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 an print statement
|
||||
$foo = "foobar";
|
||||
$bar = "barbaz";
|
||||
|
||||
print "foo is $foo"; // foo is foobar
|
||||
|
||||
// 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;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<simpara>
|
||||
See also: <function>echo</function>, <function>printf</function>,
|
||||
See also <function>echo</function>, <function>printf</function>,
|
||||
and <function>flush</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
|
Loading…
Reference in a new issue