If you are constructing a dynamic site using PHP (See "Separating Content from Design," earlier in this chapter) or using PHP for other programmatic purposes on your site, it makes sense to use the PHP include mechanism.
"Whatever technology you use to serve your site, it undoubtedly has an include mechanism that works pretty much like server-side includes and PHP includes ."Most Linux and Apache based web hosts provide PHP scripting automatically for files named with a .php file extension. Within these files, PHP includes work almost exactly like server-side includes.
For example, suppose you have a simple little web home page in a file named index.php:
Note that you can include PHP codeincluding other PHP include directiveswithin PHP includes and that there is no requirement that includes be named with any particular file suffix.
0 Comments:
Post a Comment