I have 2 php files: "1.php" & "2.php".
"1.php" with content like this:
<?PHP
$url = "http://www.google.com/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec($ch);
echo $html;
curl_close($ch);
?>
when I go to http://domain.com/1.php -> it will return content of www.google.com
The question is:
How can I get the URL which is the "www.google.com" of "1.php" using "2.php"?
(I want when I go to "http://domain.com/2.php" it would show "www.google.com" text.)