Cameron Garnett/Testpage6

From WikiEducator
Jump to: navigation, search
PHP

Super Quick PHP Tutorial

Introduction | Basic Syntax | Sending Data to the Browser | Comments | Variables | Strings | Functions | Quotes | Debugging | Form


VmvIcon Objectives.png

Learning Objectives

By the end of this page you will know how to write comments with php code.

Comments

When you are working with comments you dont have to have a semicolon at the end of a line. Comments are jus text that don't get parsed or recognised by the browser and therefore wont be displayed.


VmvIcon Example.png

Example

<!DOCTYPE html>
<html>
<body>

<?php
// This syntax is used to comment out a single line.

# This syntax is used to also comment out a single line.

/* This syntax is used to comment out a
block of code
that spans over multiple lines */

This also works well if you want to /* comment */ out a small part of code in a single line.
?>
</body>
</html>

to view a working file of this code click: https://drive.google.com/open?id=0B32fRC9Ry0IrWlREQkszTEFTaDg&authuser=0

VmvIcon Objective.png

ACTIVITY

write the above block of code into notepad ++ and get yourself familiar with the different ways you can comment out your code.