<?php echo "I like About" ?>This would return the statement I like About. Notice when we echo a statement, it is contained within quotation marks [ââ].
Another way to do this is to use the print function. An example of that would be:
<?php print "I like About" ?> There is a lot of debate about which is better to use or if there is any difference at all. Apparently in very large programs that are simply outputting text the ECHO statement will run slightly faster, but for the purposes of a beginner they are interchangeable.
Another thing to keep in mind is that all of your print/echoing is contained between quotation marks. If you want to use a quotation mark inside of the code, you must use a backslash:
<?php print "Billy said \"I like About too\"" ?>
When you are using more than one line of code inside your php tags, you must separate each line with a semicolon [;]. Below is an example of printing multiple lines of PHP, right inside your HTML:
<html>
<head>
<title>PHP Test Page</title>
</head>
<body>
<center><b>
<?php
print "I like About";
print "<br>";
print "Billy said \"I like About too\""
?>
</b></center>
</body>
</html> As you can see, you can insert HTML right into your php print line. You can format the HTML in the rest of the document as you please, but remember to save it as a .php file.


