Backend Development 2 min read

PHP readline_info Function – Get and Set Readline Variables

The PHP readline_info function retrieves or sets internal readline variables, returning all settings as an array when called without arguments or the previous value when a variable name (and optional new value) is provided, with usage illustrated by a complete code example.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
PHP readline_info Function – Get and Set Readline Variables

The readline_info function in PHP allows you to retrieve or set internal readline variables.

When called without arguments, it returns an associative array containing all current readline settings such as done , end , prompt , and others. If one or two arguments are provided, the function sets the specified variable and returns its previous value.

Parameters:

varname (string) – the name of the variable to get or set.

newvalue (string, optional) – the value to assign to the variable.

Return value:

Without parameters: an array of all readline settings.

With parameters: the original value of the specified variable.

Example usage:

backendCLIdocumentationPHPreadline
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.