What are some alternative methods to accessing local files in PHP that do not require user configuration changes?

When accessing local files in PHP, some hosting environments may have restrictions that prevent direct file access. One alternative method to access local files without requiring user configuration changes is to use PHP's built-in functions like file_get_contents() or cURL to read the contents of the file and display it.

// Using file_get_contents to read a local file
$file_contents = file_get_contents('path/to/file.txt');
echo $file_contents;