The rules for code blocks within a language dictate where you can declare variables, how you "bracket" code, etc.
PHP Code Blocks
In .PHP html pages, you embed PHP code between <?PHP and ?>.
PHP Alternative Syntax
Although I don't like to use it, PHP offers an alternative syntax for if, while, for, foreach, and switch. These code blocks are surrounded by statement ending keywords that all use End with camel caps such as endif, endwhile, endfor, endforeach,and endswitch.