When using the PHP.net website, there is even no need to get to a search box to access the content you would like to see quickly. You can use short PHP.net URLs to access pages directly.
Note, that these shortcuts are expected to work on all mirror sites, not just at the main site. If you find that some of these shortcuts are not working on your mirror site, please report them as a "PHP.net Website Problem" at http://bugs.php.net/.
There are currently three types of URLs you can use this way.
If you write in a PHP.net URL, like http://php.benscom.com/get-involved, first this URL is matched against the PHP.net pages. If there is a page named get-involved.php, then you'll get that page immediately. This type of shortcut makes easy to type in a link in an IRC conversation or mailing list message. If the script finds no page with this name, it tries to find a manual page.
If your URL can't be matched with a page name, a manual page is searched for your query. This is the case for the http://php.benscom.com/preg_match URL. The following pages are searched for in the manual:
- Chapter pages, like http://php.benscom.com/installation
- Reference pages, like http://php.benscom.com/imap
- Function pages, like http://php.benscom.com/join
- Class pages, like http://php.benscom.com/dir
- Feature pages, like http://php.benscom.com/safe_mode
- Control structure pages, like http://php.benscom.com/while
- Other language pages, like http://php.benscom.com/oop
Since there are several manual pages that could potentionally match the query (extension, class, function name..) you are encouraged to use their prefix/suffix:
- Extension TOC: http://php.benscom.com/book.extname (ex: http://php.benscom.com/book.dom).
- Extension intro pages: http://php.benscom.com/intro.extname (ex: http://php.benscom.com/intro.array).
- Extension setup TOC: http://php.benscom.com/extname.setup (ex: http://php.benscom.com/intl.setup).
- Extension install chapter: http://php.benscom.com/extname.installation (ex: http://php.benscom.com/apc.installation).
- Extension configuration: http://php.benscom.com/extname.configuration (ex: http://php.benscom.com/session.configuration).
- Extension resources: http://php.benscom.com/extname.resources (ex: http://php.benscom.com/mysql.resources).
- Extension constants: http://php.benscom.com/extname.constants (ex: http://php.benscom.com/image.constants).
- Class synopsis: http://php.benscom.com/class.classname (ex: http://php.benscom.com/class.xmlreader).
- Class method: http://php.benscom.com/classname.methodname (ex: http://php.benscom.com/pdo.query).
- Functions: http://php.benscom.com/function.functionname (ex: http://php.benscom.com/function.strpos).
This kind of URL will bring up the manual page in your preferred language. You can always override this setting by explicitly providing the language you want to get to. You can embed the language in the URL before the manual search term. http://php.benscom.com/hu/sort will bring up the Hungarian manual page for sort() for example.
At last, if there is no PHP page, and there is no manual page matching your query, a search is issued on the site with the query you typed into the URL. An example of this kind of URL is http://php.benscom.com/search_for_this. The exact behaviour of this search is affected by your own My PHP.net settings.
PHP Developer shortcuts
- Snap downloads: http://snaps.php.net/?53 (ex: latest 5.3 snap. Use ?trunk or ?latest for latest trunk)
- Changelog information: http://php.net/changelog (ex: latest PHP changelog. php5news = latest PHP 5 NEWS, phptrunknews = latest PHP trunk NEWS)
- Bugs: http://php.net/42 (any numeric value redirects to said bug # at bugs.php.net)
- reST based README info: http://php.net/reST/ (lists several README files)
Even smarter tricks
We also have shortcut aliases to access some resources more quickly, and with a nice URL. Aliases are translated to their relevant shortcuts before the first step (PHP page search) mentioned above. Some examples of shortcut aliases: http://php.benscom.com/whatisphp, http://php.benscom.com/php4news. The latter is an external page alias, as it points to a file on the Git server, containing information about changes in PHP. There are also some convenient aliases, like http://php.benscom.com/de/phpversion which displays the German manual page for the phpversion() function.
Get it on your site
What enables PHP.net to have this feature is a combination of some ErrorDocument Apache settings, redirecting the browser to another page in case of an "Error 401/3/4" and a little search script that looks up page names or functions names in the manual corresponding to what you searched for in http://php.benscom.com/search_for_this. We also have a general language selection method.
Everything behind this feature is available here: