php man page for print

Query: print

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

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)
Related Man Pages
text::glob(3) - centos
text::glob5.18(3) - mojave
call_user_func_array(3) - php
unset(3) - php
text::glob(3pm) - debian
Similar Topics in the Unix Linux Community
Substitute variable values
Sub. numbers in column of output with If
how to make syntax into a korn script??
Removing duplicates from string (not duplicate lines)
Merging multiple lines into single line based on one column