0

简单的问题,在 Java 中,有 Timer 类,或 AlarmManager,甚至是一个 while(true) 循环来重复一些代码,我如何用 Php 代码实现,我想重复一些 PHP 代码/脚本,我尝试过:

 while(true){
 ////Give me an Error , 'No Data Received from WebSite/Not Response
 }

 function Check(){
 ////Do Code
 Check()
 ////Syntax and Others Error , does Not Work
 }

 echo "<script>setTimeout('check()',10);"; ////does not Work too


 Additional Code :

 $q=mysql_query("SELECT message FROM $tbl_name WHERE pass='".$_SESSION['Logged']."'");
 while($row = mysql_fetch_array($q)){
 while(true)
 echo $row['message']; ///In French Language saying that the server closed the connection without sending any      Data, 
 Error : Erreur 324 (net::ERR_EMPTY_RESPONSE) : Le serveur a mis fin à la connexion sans envoyer de données.

 }
4

1 回答 1

0

无法获得您想要做的事情,但据我了解您的问题,您可以使用以下内容:

while ($something == true )
{
 //code to process here and keeps repeating until condition is met.
 myFunction();

}

function myFunction(){
//code of your function
}
于 2013-02-23T12:31:06.567 回答