PHP: problem with using file_get_contents()

Hi guys,

I have a problem with using the file_get_contents() method. My script is as follows:


<?php
	$url = "http://www.google.com/";
	$content = file_get_contents(urlencode($url)) or die("Can't open URL");
	echo $content;
?>

Whenever I run this script, it would fail with the “Can’t open URL” message. Any idea why it didn’t work? Thanks in advance.