When you start working with a new language, like PHP, chances are that you will make lots of syntax errors. A syntax error is a missed semicolon, an unclosed parenthesis and so on. To detect these errors, you will usually have to call up your page in a browser,PHP script is executed on the server, and the plain HTML result is sent back to the browser.A PHP file normally contains HTML tags, and some PHP scripting code.Below, we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function "echo" to output the text "Hello World!" on a web page:
A comment in PHP code is a line that is not read/executed as part of the program. Its only purpose is to be read by someone who is editing the code!
In PHP, all user-defined functions, classes, and keywords (e.g. if, else, while, echo, etc.) are NOT case-sensitive.
In the example below, all three echo statements below are legal (and equal):
In the example below, only the first statement will display the value of the $color variable (this is because $color, $COLOR, and $coLOR are treated as three different variables):