file_get_contents
doesn't accept a relative URI. It takes either an absolute URI or a file path.
Using a file path is faster because:
- Reading from the file system
is less work than:
- Making an HTTP request
- Reading the request
- Loading a file from the file system (possibly executing PHP on the way)
- Putting it in an HTTP response
- Sending the response
- Reading the response
- Getting the file data out of the response body