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.
readline_completion_function
(PHP 4, PHP 5)
readline_completion_function — Registra una función de completitud
Descripción
boolean readline_completion_function
( string $line
)
Esta función registra una función de completitud. Debe proporcionar el nombre de una función existente que acepte una línea de comandos parcial y devuelva una array con posibles coincidencias. Es el mismo tipo de funcionalidad que se obtiene al pulsar la tecla de tabulación cuando se está usando el Bash.
readline_completion_function
david at acz dot org
01-Feb-2005 08:08
01-Feb-2005 08:08
john at weider dot cc
21-Sep-2002 04:32
21-Sep-2002 04: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.
