Hello everybody,
I this possible to read the entire HTML of a url say http://www.google.com into a PHP variable.
Thanks.
Printable View
Hello everybody,
I this possible to read the entire HTML of a url say http://www.google.com into a PHP variable.
Thanks.
Use file_get_contents(url).
Thanks.
I got this solution with javascript with a google search.
Code:function GetData()
{
var url = "http://www.yahoo.com";
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST",url,false);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send();
var result = xmlhttp.responsetext;
alert(result);
}
I thought you wanted the source to be stored in as a PHP variable? :confused:
Yeah, you are right. I am trying to find a way to get javascript script variable in PHP. penagate's recommended function is also good.
Thanks.