phpRiot.com posted a new article on creating search engine friendly URLs in PHP. I always like to see this topic get attention, there are too many sites on the web that generate very long and difficult to read URLs. Usually this involves transforming GET parameters into part of the URL. Here is an example of a URL using GET parameters:
http://www.example.com/articles/?post_id=987654321
Here is an example using a more pleasant URL:
http://www.example.com/articles/title/nice-php-urls
The phpRiot article goes on to describe different methods for achieving this.
There are times when you only want to have your PHP scripts run when certain conditions have (or haven’t) been met. This technique is often used for caching. A real life example of this is discussed in Serving rendered images at the speed of light. The gist of the story is that a PHP script is used to generate thumbnails of images, but it only needs to be called when a thumbnail doesn’t already exist.
The described solution involved making use of Apache’s mod_rewrite, so this isn’t a purely PHP solution. If you aren’t already familiar with mod_rewrite that is okay (I’ve used and it is still quite confusing at times), the author covers each step one at a time.