xxxxxxxxxx
<?php
$a = 'Hello World!'
//for echoing
echo $a;
?>
<!--shorthand on PHP x HTML templating-->
<h1><?= $a; ?></h1>
xxxxxxxxxx
<?php
$motto = " my first book ";
$newMotto = str_replace("first", "best", $motto);
$newMotto = trim($newMotto);
echo "<p> $motto </p>";
echo "<p> $newMotto </p>";
echo substr($newMotto, -4);
?>
xxxxxxxxxx
<?php
session_start();
if (isset($_SESSION['school']) && isset($_SESSION['course']))
echo "<p> Your choice is " . $_SESSION['course'] .
" in ". $_SESSION['school'] . ". </p>";
?>
xxxxxxxxxx
$? Expands to the exit status of the most recently executed foreground pipeline.
echo $? will return the exit status of last command.