【发布时间】:2011-05-16 16:04:07
【问题描述】:
我正在尝试了解如何运行以下 php:
$html = file_get_contents(curPageURL()); //where curPageURL() returns the current page URL
不会导致无限循环
编辑
我需要将整个渲染页面的内容放在一个变量中。
我试过了:
if(!isset($_COOKIE['page_fetch'])){
$html = file_get_contents(curPageURL());
setcookie('page_fetch',$html, time()+20,'/');
} else {
$html = $_COOKIE['page_fetch'];
}
【问题讨论】:
-
我正试图弄清楚为什么你会这样做......
-
你实际上是在做
10 GOTO 10。 -
也许如果你包括你正在尝试做的事情可能会有所帮助。正如问题所写,如果没有无限循环,您将无法做您想做的事情。
标签: php logic infinite-loop