Thread: html source
View Single Post

  #3 (permalink)  
Old 02-16-2007
yoko
 
Posts: n/a
Default Re: html source


That worked no problems. What about cURL is that a good method as well?

Hello Dennis,

> // Get the HTML file
> $html = file_get_contents($url);
> // Reduce it to the contents of the <body> tag
> $body = preg_replace("#^.*<body[^>]*>(.*)</body>.*$#si", "\\1",
> $html);
> // Strip of whitespace at the beginning and the end
> $body = trim($body)



Reply With Quote