php echo variable code example
Example 1: How to show php text
<?php
echo "Hello World!";
// You can also do this with a variable:
$YourVariable = "Hello World!";
echo $YourVariable;
?>
Example 2: php echo variable
<?php
$name = "John Doe";
echo "Hey $name!";
?>
Example 3: php echo html and variable
echo '<img src="' . $Variable . '">';
Example 4: PHP echo and print Statements
<?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?>
Example 5: echo php
<?php
$string = "Hello, World!";
echo $string;
?>
Example 6: php variable in echo
echo 'Hello '.$variableName.'!';