I am trying get my head around how you can run the following php:
$html = file_get_contents(curPageURL()); //where curPageURL() returns the current page URL
without causing an infinite loop
EDIT
I need to have the contents of the entire, rendered page, in a variable.
I have tried:
if(!isset($_COOKIE['page_fetch'])){
$html = file_get_contents(curPageURL());
setcookie('page_fetch',$html, time()+20,'/');
} else {
$html = $_COOKIE['page_fetch'];
}
I’m not sure why you’d want to, but could you pass a variable telling it to stop?