In PHP, we have a function called file
which, when opening a file, causes each line to be placed in an item of a array
.
Example:
hello.txt
olá
mundo
php script
file('hello.txt'); // array('olá', 'mundo')
In Python, how could I do to read each line of file in an item of a list
or tuple
?
Is there a simple way to do it in PHP?