PHP Function Reference


Welcome to PHPfr!

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

Overview

PHPfr has dozens of features to help you, the busy PHP developer, find the information you need fast.

Fast Function Lookup

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.

Live filtering

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.

Group by Topic

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.

Don’t lose your place

If you need to temporarily reclaim space on your Dashboard, you can close the page drawer using the close drawer icon. Click it again to open the drawer.

Favorites

PHPfr allows you to save your favorite (or least favorite?) functions for quick reference. Just click the Add to favorites icon at the top of the window on any function page to add it to your favorites list. Click the Show favorites icon at the bottom of the function list to view your favorites list.

History

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.

Resizable Interface

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 font size toggle button at the bottom of the widget to toggle between the 2 sizes.

Cheat Sheet

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 cheat sheet icon is the key to your success…

Regular expressions

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.

$_SERVER

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.

Constants

PHP creates a number of “magic” constants you can access anywhere in your scripts. The constants section lists many of the most common ones.

fopen() modes

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.

Comparisons

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.

Interactive Date Formatter

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.

Output of phpinfo()

It ain’t pretty, but you can see a plain text dump of the output of the phpinfo() function by clicking the phpinfo() icon.

Offline Documentation

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.

Documentation in Your Language

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.

Pick Your Binary

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 lock icon and enter the full path to the binary (e.g., /usr/bin/php).

Acknowledgments

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!

Inspiration for PHPfr

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.

Version History

1.0 – April 6, 2008
Resizable widget interface
Adjustable font size
User can now set the path to the PHP binary
Select functions by topic (e.g., Arrays, Strings, MySQL, etc.)
1-click installation of new documentation languages
Localized in English, French, Spanish, German, Italian, and Romanian
0.9.6.2b – February 24, 2007
Updated default (English) documentation to the most recent version on PHP.net (20 Feb, 2007).
0.9.6.1b – July 2, 2006
Fixed a minor bug that would prevent the widget from loading for the first-time user (because the language preference was not set).
0.9.6b – June 29, 2006
Mac OS X 10.4.7 changed the behavior of widget.system calls. Synchronous calls now break widgets, whereas before they were tolerated (though discouraged). In this version, I fixed my widget.system calls to be asynchronous.
0.9.5b – March 23, 2006
Added integrated version checking.
0.9.4b – March 20, 2006
With help from the dashboard-dev mailing list, I got the Chinese Cantonese, Chinese Traditional, and Romanian versions of the documentation working.
0.9.3b – March 20, 2006
Dashboard expects all input to be UTF-8. Some versions of the PHP documentation (Chinese Cantonese, Chinese Traditional, and Romanian) are encoded in other charsets. The fact these languages will not work is now documented in the FAQ.
Fixed language installation instructions in the FAQ.
0.9.2b – March 19, 2006
Actually fixed bug where English was not set as default language on first run.
0.9.1b – March 18, 2006
Fixed bug where English was not set as default language on first run.
0.9b – March 17, 2006
Initial preview release

License & Terms of Use

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.

PHP Documentation Copyright Notice

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/.