In PHP, how can you prevent file caching when reading a file?
- Use file_get_contents() with caching disabled
- Use fopen() with the appropriate caching flags
- Set appropriate headers using the header() function
- Use readfile() with caching options
To prevent file caching when reading a file in PHP, you can set appropriate headers using the header() function. This approach instructs the client not to cache the file. Options 1 and 2 do not specifically address caching.
Loading...
Related Quiz
- You need to understand if a PHP class can have more than one constructor. What would be your conclusion?
- Which of the following are common uses of multidimensional arrays in PHP?
- You have two arrays, one with keys and another with values. You need to combine them such that keys from the first array map to values from the second. Which PHP function would you use?
- The PDO attribute that controls the error reporting mode is named ________.
- The fopen() function is used to open a file in PHP.