There are different ways to interpolate in certain different languages to simplify spacing and printing out variables.
JavaScript
Code: Select all
<html>
<head></head>
<body>
<script>
var a_certain_animal_species = "dog";
window.alert("The ${a_certain_animal_species} is a popular companion in many cultures.");
window.alert("The" + " " + a_certain_animal_species + " " + "is a popular companion in many cultures.")
</script>
</body>
</html>
Php
Code: Select all
<html>
<head></head>
<body>
<?php
$a_certain_candy_type = "caramel";
echo "Some people like {$a_certain_candy_type}.";
echo 'Some people like' . ' ' . $a_certain_candy_type + '.';
echo "Some people like $a_certain_candy_type.";
?>
</body>
</html>
