readline_list_history
Description
The readline_list_history of Readline for PHP lists the history.
Syntax
readline_list_history(): array
Return
Returns an array of the entire command line history. The elements are indexed by integers starting at zero.
Examples
1 · void
<? $return = readline_list_history(); print_r($return); readline_clear_history();
Array ( )
2 · readline_add_history · single
<? $prompt = readline(); readline_add_history($prompt); $return = readline_list_history(); print_r($return); readline_clear_history();
Array
(
[0] =>
)
3 · readline_add_history · multiple
<?
for($i = 0; $i < 3; ++$i)
{
$prompt = readline();
readline_add_history($prompt);
}
$return = readline_list_history();
print_r($return);
readline_clear_history();
Array
(
[0] =>
[1] =>
[2] =>
)