You may already know that PHP is a great language for making database-driven sites. But what else can you do with it?
All kinds of things. One glance at the manual's table of contents will tell you that.
The most immediate use for PHP is to let you put logic into your HTML. Should I include fragment A or fragment B? What if someone looks at my page with a browser that doesn't support frames? As you may have read elsewhere, you can use eXtended server-side includes (XSSI) to solve some of these problems. But XSSI is extremely limited: It can provide if-thens with some pattern matching, access to environment variables, string concatenation, and file includes. That's it.
PHP gives you all the tools you'd expect from a programming language: for and while loops, math operators (adding, subtracting you know, math), and so on. You can also include files in two ways: directly or as a request to the server. In XSSI, all your includes are server requests. So using PHP can cut down on the number of hits a single page generates. Already you're saving money!
But wait, there's more. Much more. Let's look at a couple of examples of how PHP can be used for site navigation.
next page»