Php Echo

Partea 1

Partea 2

[codesyntax lang=”php” container=”div”]

<?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='http://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';
?>

[/codesyntax].

Lasă un răspuns

Adresa ta de email nu va fi publicată. Câmpurile obligatorii sunt marcate cu *