Cameron Garnett/Testpage10

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 understand how to use Quotes when you are dealing with php code.

Quotes

In PHP it is important to understand how single and double quotation marks are used to give different results.

VmvIcon Example.png

Example

<!DOCTYPE html>
<html>
<head></head>
<body>
<?php
$bird = 'black';

echo "bird is equal to $bird";
echo 'bird is equal to $bird';

echo "\$bird is equal to $bird";
echo '\$bird is equal to $bird';
?>
</body>
</html>


VmvIcon Objective.png

Activity

To see the differences in the output, write this block of code into notepad++ and save it in your web folder as quotes.html