What are the fundamental concepts that should be understood before attempting PHP code manipulation within HTML output?

Before attempting PHP code manipulation within HTML output, it is essential to understand the basics of PHP syntax, variables, functions, and control structures. Additionally, a good grasp of HTML markup and how PHP can be embedded within it is crucial. Lastly, understanding how to properly sanitize user input to prevent security vulnerabilities is important.

<?php
// Example PHP code snippet demonstrating basic concepts
$name = "John";
$age = 30;

echo "Hello, my name is $name and I am $age years old.";
?>