note 38422 added to function.print
| From: | PHPHelper at rn2 dot php dot net | Date: | Sat, 20 Dec 2003 06:44:30 +0000 |
| Subject: | note 38422 added to function.print | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62259@lists.php.net to get a copy of this message | ||
The simplest way to do a print statement is as follows:
<?php
print "hello";
?>
Which prints out the following:
hello
Just put whatever you want to print in parentheses after the word "print", and follow it
up with a semi-colon.
Next, if you are printing multiple lines, be sure to use <br> at the end of your print
statement, inside the parentheses, like this:
<?php
print "hello<br>";
print "how are you?<br>";
?>
Which will print:
hello
how are you?
Without <br> in your print statemnt, the two lines would have been combined like the
following:
hellohow are you?
And, we wouldn't want that.
Next, if you want to print a blank line between the two lines, insert the following code between the
two lines:
print " <br>";
So that you're code will look like the following:
<?php
print "hello<br>";
print " <br>";
print "how are you?<br>";
?>
This will print the following:
hello
how are you?
----
Manual Page -- http://www.php.net/manual/en/function.print.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38422
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38422&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38422&report=yes
Search -- http://master.php.net/manage/user-notes.php