I\'ve got this piece of code, which should fetch the source code of the website.
$homepage = file_get_contents(\'http://homepage.com\');
echo $homepage;
That's because you're fetching the source code and (re)outputting it. Your page is just mirroring http://homepage.com.
To see the actual page source, add a Content-Type header before your echo statement:
header('Content-type: text/plain');
This tells the browser treat the source as plain text and not interpret it as HTML.