The top paid web designers got where they are today because they know how to code quickly, efficiently, and to the requests of their clients. Knowing PHP as a language and using its many functions or constructs is going to be mandatory if one is going to rise to the top. Somewhere along the way, the PHP include command will need to be learned. Normally we woudl call the include statement a function, since it acts and behaves like one. Don't let the exterior fool you, because the include statement is actually what we call a language construct. This phrase is just a simple term for describing a statement in PHP that is so common that we would regard it as an internal component. The number one reason to use a PHP include is to save time. As it is said, time is money, and saving time can give way to more work- which means more money. Time is saved with the PHP include since we can use includes to dynamically change multiple pages at once. By referencing a single remote file on each page, we can update every page through one file. Many use the PHP include simply to get better organization- as if commenting one's code wasn't enough. PHP includes allow one to cut down many lines of code, but the application won't be any faster as a result. The contents of the remote file are still being read into the current application upon execution. Just because the code isn't there doesn't mean it isn't processed. While it may not be a targeted benefit, the icing on the cake of using the PHP include command is going to be that it will break an application if something fails in the included file. This may seem like a bad thing, but it lets developers track down problems where timing is key to getting things back up and running. In most cases, however, we are going to use the PHP require command instead. Because PHP will only function under the PHP extension, web developers should get into the practice of forgetting the HTML extension and switching to PHP. If they don't, the time will come when they see that PHP is the better alternative, and fixing the extension on hundreds of pages isn't going to be much fun at that point in time. Closing Comments Knowing how to use the PHP include command and know the theory of the command are two very different things. From here, readers will need to be able to know how to use the command in everyday settings. Consult the Internet for more information on this, and where to find the best PHP include tutorial. |