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

What does php print mean?

藏色散人
Release: 2023-03-01 17:38:02
Original
3996 people have browsed it

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!";
?>
Copy after login

Output:

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

Example 2

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

Output:

This text spans multiple lines.
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template