readline_completion_function

(PHP 4, PHP 5)

readline_completion_function -- Registers a completion function

Description

bool readline_completion_function ( callback function )

This function registers a completion function. You must supply the name of an existing function which accepts a partial command line and returns an array of possible matches. This is the same kind of functionality you'd get if you hit your tab key while using Bash.


add a note add a note User Contributed Notes
david at acz dot org
02-Feb-2005 04:08
This function can simply return an array of all possible matches (regardless of the current user intput) and readline will handle the matching itself.  This is likely to be much faster than attempting to handle partial matches in PHP.
john at weider dot cc
22-Sep-2002 12:32
It seems that the registered function can accept 2 parameters, the first being the partial string, the second a number that when equal to zero indicates that the tab was hit on the first argument on the input. Otherwise it looks like the position within the string is returned.

This is neccessary information for processing shell command line input.