![]() |
The readline_add_history() is an inbuilt function in PHP that is used to add a line to the command line history. Syntax:readline_add_history($prompt): bool Parameter:This function accepts only a single parameter that is described below.
Return Value:The return value of the readline_add_history() function is a boolean value. If this function successfully adds a line to the command line history, then it will return “true” otherwise on failure it will return “false”. Program 1: The following program demonstrates the readline_add_history() Function. PHP
Output
Array ( [0] => First line [1] => Second line [2] => Third line ) Program 2: The following program demonstrates the readline_add_history() Function. PHP
Output
[2] Line 3 [1] Line 2 [0] Line 1 Program 3: The following program demonstrates the readline_add_history() Function. PHP
Output
[0] Line 1 [1] Line 2 [2] Line 3 [3] Line 4 [4] Line 5 Reference: https://www.php.net/manual/en/function.readline-add-history.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |