What is the purpose of the file_get_contents() function in PHP?
- To read the contents of a file into a string
- To write data to a file
- To rename a file
- To delete a file
The file_get_contents() function in PHP is used to read the contents of a file and return them as a string. It takes the file name or URL as a parameter and returns the contents of the file. This function is commonly used to read files and retrieve their contents. Learn more: http://php.net/manual/en/function.file-get-contents.php
Loading...
Related Quiz
- How is a constant defined in a PHP script?
- You need to prevent form submission in your PHP script if a required field is left empty. How would you do this?
- Which of the following statements about variable scope in PHP are correct?
- What is the default keyword used for in a PHP switch statement?
- What are the potential issues with a do...while loop in PHP?