Home >Backend Development >PHP Problem >What does php print mean?

What does php print mean?

藏色散人
藏色散人Original
2020-06-29 10:51:213971browse

php print is a language structure used to output one or more strings, and print is not actually a function, so there is no need to use parentheses for it, and "print" is better than "echo" in php Slightly slower.

What does php print mean?

php print

php print is a language structure used to output one or more String. print is not actually a function, so you don't have to use parentheses with it.

Example 1

<?php
$str = "Who&#39;s John Adams?";
print $str;
print "<br />";
print $str."<br />I don&#39;t know!";
?>

Output:

Who&#39;s John Adams? Who&#39;s John Adams? I don&#39;t know!

Example 2

<?php
print "This text spans multiple lines.";
?>

Output:

This text spans multiple lines.

print() function is better than echo() Slightly slower.

The above is the detailed content of What does php print mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn