$name="Fred"; echo "<p>Hello "; echo $name; echo ", how are you?</p>";
Look through that and you should be able to see what it will do once you know that $ marks a variable in PHP:
- put the name into a container
- echo a piece of text (which happens to be HTML) to the page
- echo the content of the variable/container
- echo more text including the end the HTML element
The code is ugly and that is one of the problems with PHP. You will learn a slightly better way soon but it still often looks cluttered.
Upload and try. View the source of the page in your browser and you should see a paragraph element (although it has messed your nice indenting up). The PHP has combined the data in the variable with text to make a new paragraph. None of the PHP shows up just the HTML. Compare the code above with the end result until you see how PHP works.
$years=28; $months=$years*12; echo "<p>I understand you are "; echo $months; echo " months old</p>";
The asterisk is used for multiplication in most programming languages but apart from that the new code should be clear enough. Upload and try.