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.


































3 answers
Tue Feb 7, 2012 3:18 AM
Post by essica slaton on December 29, 2011
Help! Why is my code visible on the page?
0 answers
Post by Douglas Sunday on July 28, 2012
just wondering, can I get this course on DVD?
0 answers
Post by Douglas Sunday on July 31, 2012
Do really monitor the discussion questions posted here? If so why does it take so long for one to receive a response to a query?
0 answers
Post by David Sanford on February 14 at 04:04:17 PM
Good Day,
For some reason, I get an "Access forbidden! You do not have permission to access the requested objects" error with all of your downloaded exercise files.
Any suggestions?