E-LearningQuiz of the Day

LiveEdu Quiz of the Day: 05/01/2017

PHP Quiz

PHP Quiz of the Day Which one of the following function is capable of reading a file into an array?



The file() reads a file into an array.

Each array element contains a line from the file, with newline still attached.


Parameter Description
path Required. Specifies the file to read
include_path Optional. Set this parameter to ‘1’ if you want to search for the file in the include_path (in php.ini) as well
context Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream. Can be skipped by using NULL.

Tips and Notes

This function became binary-safe in PHP 4.3. (meaning that both binary data, like images, and character data can be written with this function).


The output of the code above will be:

If you want to explore more, visit our PHP edu & tutorials section!

Below are some examples:

Employee Holiday Manager in PHP

PHP Simple MVC Framework

About author

About Author Dr. Michael Jurgen Garbade is the founder of LiveEdu.TV, Kyuda, Education Ecosystem. He is future Venture Capitalist, Future Politician and always on the lookout for the Next Big Challenge. Obtained Masters in business administration and physics, and a Ph.D. in finance with professional work experience in high-paced environments at Fortune 500 companies like Amazon and General Electric. Expertize: Python, PHP, Sencha Touch & C++, SEO, Finance, Strategy & E-commerce. He speaks English and German and has worked in the US, Europe, and Asia. At Education Ecosystem he is the CEO and runs business operations.