Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.27 KB

README.md

File metadata and controls

50 lines (32 loc) · 1.27 KB

A Basic Introduction to PHP and Output

A basic example of using echo to create output with PHP.

This tutorial will review how to use the PHP echo command to create output. Here is a basic sample of using echo to output a "Hello World" message:

<?php 

echo '<p>Hello World!</p>';

?>

Steps

  1. Open up a new file and name it output.php.

  2. Copy the content from sample.html and paste it into your new PHP file.

  3. Convert the HTML code in between the <body> and </body> from HTML to PHP.

  4. For example the first line of HTML in the <body> tag is:

    <h1>PHP and Creating Output</h1>

    After this line is converted to PHP it will be something like this:

    <?php
    
    echo '<h1>PHP and Creating Output</h1>';
    
    ?>

Hint: Convert each line of HTML to PHP one line at a time. Test your PHP after converting each line of code.

Full tutorial URL:
https://codeadam.ca/learning/php-output.html


Repo Resources