Unix and Linux Discussions Tagged with print |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
64,507 |
Shell Programming and Scripting |
|
|
|
6 |
7,971 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
11,535 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
5,878 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,785 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,070 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,842 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,460 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
3,931 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
4,600 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
11,410 |
Shell Programming and Scripting |
|
|
|
18 |
4,828 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
6,580 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
3,121 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,737 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
3,646 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
3,821 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
7,560 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
7,247 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
4,754 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
2,678 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
4,646 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
3,106 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,256 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
2,789 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
9,730 |
Shell Programming and Scripting |
|
|
|
7 |
5,961 |
Shell Programming and Scripting |
|
|
|
0 |
1,914 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,491 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
6,592 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,848 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,169 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
4,179 |
Shell Programming and Scripting |
|
|
|
3 |
1,510 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
2,499 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,005 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
3,371 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,079 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
1,483 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,700 |
Shell Programming and Scripting |
PRINT(3) 1 PRINT(3)
print - Output a string
SYNOPSIS
int print (string $arg)
DESCRIPTION
Outputs $arg.
print is not actually a real function (it is a language construct) so you are not required to use parentheses with its argument list.
PARAMETERS
o $arg
- The input data.
RETURN VALUES
Returns 1, always.
EXAMPLES
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
multiple lines. The newlines will be
output as well.";
print "escaping characters is done "Like this".";
// You can use variables inside 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;
?>
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
SEE ALSO
echo(3), printf(3), flush(3), Heredoc syntax.
PHP Documentation Group PRINT(3)