read_file($file)
Parameters: |
|
---|---|
Returns: |
File contents or FALSE on failure |
Return type: |
string |
Returns the data contained in the file specified in the path.
Example:
$string = read_file('./path/to/file.php');
The path can be a relative or full server path. Returns FALSE (boolean) on failure.
Note
The path is relative to your main site index.php file, NOT your controller or view files. CodeIgniter uses a front controller so paths are always relative to the main site index.
Note
This function is DEPRECATED. Use the native file_get_contents()
instead.
Important
If your server is running an open_basedir restriction this function might not work if you are trying to access a file above the calling script.
Please login to continue.