Register|Login

Have a question? Click here to ask the community.

Tutorial 5 – Echo

| In: 5. Echo | 17,075 views

Video Tutorial

Part 1:


Part 2:


Video Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// File Description: PHP - Echo Command Tutorial
$aString = "<b>Hello Robert. </b>";
$total = 400;
 
echo $aString;
echo "<br>"; // the line break
echo "<u>Hello World</u>";
 
echo "<img src='https://www1.free-clipart.net/gallery2/animations/animals/1.gif'>";
 
// Robert said, "Hello Youtubers".
echo "Robert said, \"Hello Youtubers\"";
 
// echoing variables example
$question = "What is 2 + 2? ";
$answer = 4;
 
echo $question;
echo $answer;
 
//echoing text strings and variables
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
echo "<br><br>What is 2+2? That's easy, 2+2 is $answer";
 
echo "<br>";
echo "$answer";
echo '$answer';
?>

Comment Form

You must be logged in to post a comment.