There is a console script. I want to add the ability to select a file from the directory.

The most primitive:

Scan the catalog and display its contents:

foreach (scandir('./Data') as $file){ echo $file."\n"; } 

And now how can I make the user click on an example up or down arrow to select the desired file.

    1 answer 1

    If you throw out the fantasy about arrows from your head, and decide to make a normal console script, then simply transfer the file name to the script as a parameter - as 100% of console scripts written in PHP do. Users of console scripts are usually able to find the file they need on their own.