Can anyone explain why the following code returns a warning:
I get a Warnin
If you run this code:
in http://codepad.org/NHMjzO5p you see the following array:
Array
(
[0] => php
[1] => file
[2] => data
)
Run the same code in on Codepad.Viper - http://codepad.viper-7.com/lYKihI you will see that the http stream has been enabled thus file_get_contents not working in codepad.org.
Array
(
[0] => https
[1] => ftps
[2] => compress.zlib
[3] => php
[4] => file
[5] => glob
[6] => data
[7] => http
[8] => ftp
[9] => phar
)
If you run your question code above in Codepad.Viper then it open the google page.
The difference thus is the http stream that is disable in your CodePad.org and enabled in CodePad.Viper.
To enable it read the following post How to enable HTTPS stream wrappers. Alternatively use cURL.