PHP Function Reference (PHPfr) lets you quickly look up function definitions using a downloaded copy of the documentation from PHP.net. PHPfr also includes an extensive cheat sheet of common PHP syntax as well as an interactive date formatter.
If you are new to PHPfr, I encourage you to read the overview section to get familiar with the widget’s features.
PHPfr is free software, but donations are welcome. Please file bug reports at the project home on Google Code.
I hope you enjoy PHPfr as much as I’ve enjoyed building it!
–Andrew Hedges, developer of PHPfr
PHPfr has dozens of features to help you, the busy PHP developer, find the information you need fast.
PHPfr’s reason for being is to help you, the busy PHP developer, lookup function definitions fast.
Click on a function name to see its definition in the righthand frame. Double click a function to visit its page on PHP.net.
Type a few letters from any part of a function name to narrow the list of functions to ones that match. You can even use regular expressions!
For example, entering [0-9]$
will match only functions ending in a number. Learn the basics of regular expressions in the cheat sheet.
A new feature of PHPfr 1.0 is the topic select list. Choose a topic from the drop-down list at the top of the function list and only functions related to that topic (e.g., Arrays) will display in the list.
If you need to temporarily reclaim space on your Dashboard, you can close the page drawer using the icon. Click it again to open the drawer.
PHPfr allows you to save your favorite (or least favorite?) functions for quick reference. Just click the icon at the top of the window on any function page to add it to your favorites list. Click the
icon at the bottom of the function list to view your favorites list.
PHPfr tracks your path through its pages, allowing you to quickly go back to a previous screen. The and
buttons let you go back and forward, respectively, through your history.
New in version 1.0 is the ability to resize the PHPfr interface to best fit your monitor. Use the presets in the --Select a Size--
drop-down (at the bottom right of the widget) or just drag the resize handle to the desired size. PHPfr will scale from 450x290 up to 1200x900 pixels.
Additionally (and also new in version 1.0), you can toggle between 2 font sizes, normal and slightly bigger. Click the button at the bottom of the widget to toggle between the 2 sizes.
It’s not cheating if the test is open book, right? PHPfr’s “cheat sheet” gives you quick access to information about some common PHP knowledge you shouldn’t have to store in your head. The icon is the key to your success…
The regular expressions section of the cheat sheet includes examples of simple regular expressions, basic syntax, information about the PCRE (Perl-Compatible Regular Expressions) modifiers and a list of PREG constants and their meanings.
Quick, what $_SERVER
array key returns the IP address of the server under which the current script is executing? If you answered SERVER_ADDR
you may not need this feature! For the rest of us, a list of array keys and their meanings are waiting in the $_SERVER section.
PHP creates a number of “magic” constants you can access anywhere in your scripts. The constants section lists many of the most common ones.
Is it r+
or w+
that opens a file for writing and truncates the file to zero length? No need to guess, just click through to the fopen() modes section for the answer.
Did you know that if you compare an array to anything else, the array will always be considered greater? The comparisons section offers a list of comparison operators, comparisons with different typs of operands (like the above example), comparisons using PHP functions such as is_null()
, and logic tables for both loose and strict comparisons.
If you’re like me, you don’t want to have to remember that the date format string for “Tuesday, April 1st” is l, F jS
. Luckily, you don’t have to because PHPfr has a nifty, interactive date formatter feature.
Note: If you get unexpected results using the date constants, PHPfr is likely using a pre-5.1 version of the PHP binary.
It ain’t pretty, but you can see a plain text dump of the output of the phpinfo() function by clicking the icon.
PHPfr uses a downloaded copy of PHP.net’s online documentation to enable faster access than is possible over a network connection. Also, by using downloaded documentation, you can access it when you are not online.
PHPfr ships with English language documentation installed by default. Other translations of the docs are just a click away! Flip the widget over and click on the language of your choice to download (3.3MB) and install it.
Additionally, most of the PHPfr interface is localized as well. Currently, English, German and Romanian are included, but more languages should be coming soon.
If you have more than one version of PHP installed, PHPfr gives you the ability to designate which binary to use when generating its output. This can make a difference on some systems (ahem, Tiger) that ship with version 4 of PHP installed by default. Just flip the widget over and click the icon and enter the full path to the binary (e.g., /usr/bin/php).
There are many people who have helped make PHP Function Reference possible. I want to list some of them here to publicly thank them for their contributions.
Thaks, everyone, for your help and support!
PHPfr is inspired by the venerable shareware app, PHP Function Index, written by Wolfgang Ante of ARTIS Software. I paid for my copy of PHPfi long ago, but thought it would be even more convenient to have similar functionality in widget form.
PHPfr is released under the New BSD License. PHPfr is free software, but donations are welcome.
PHPfr is open source. You are encouraged to file bug reports and feature requests at the project home on Google Code. Additionally, you can download the source code and tweak, fix, or just change how PHPfr works. Accepted patches earn you commit rights on the project, so hack away!
PHPfr is localized in several languages, but more are always welcome. Contact Andrew Hedges to find out about translating the interface into your native language.
Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/.