Loading video...
Basic PHP Syntax
- There are four valid forms of PHP delimiters: long (<?php, ?>), script (<script language="php">, </script>), short(<?, ?>), and ASP-style(<%, %>).
- The short and ASP-style PHP delimiters are not always available, as they can be enabled/disabled using php.ini , so they should not be used for portability reasons.
- The long form delimiters are recommended because they are always available and are XHTML- and XML-compliant.
- php.ini , located in 'php' folder of the XAMPP installation directory, is the global PHP configuration file that controls how PHP runs on your local webserver.
- When using XAMPP, Apache must be restarted for changes to php.ini to take effect.
- The phpinfo() function outputs information about the current PHP configuration.
- Statements are individual instructions to be executed by PHP and are always separated by semicolons.
- Comments are text added to PHP code that are ignored by the PHP interpreter and used to aid programmers in understanding the code.
- Single line comments and are delimited by either // or #. PHP interprets all text after these delimiters until either the end of the line or a PHP closing tag is reached, whichever comes first, as comments.
- Multi-line comments are signified to PHP by the start and end delimiters, /* and */. All text between this style of comment delimiters is treated as comments.
- Care should be taken to avoid the nesting of multi-line comments.
- Coding conventions describe a set of rules for how code should be formatted and written that can only be enforced by the programmer and not by the programming language. The purpose of coding conventions are to make code easier to read, understand, maintain, and debug.
- Additional Resources:
Basic PHP Syntax
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview