0

簡単な質問、Java には Timer Class 、または 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 に答える