I use following PHP function:
file_get_contents(\'http://example.com\');
Whenever I do this on a certain server, the result is empty. When I do
The setting you are looking for is allow_url_fopen.
You have two ways of getting around it without changing php.ini, one of them is to use fsockopen(), and the other is to use cURL.
I recommend using cURL over file_get_contents() anyways, since it was built for this.
file_get_contents()