Timeout dans une boucle - PhP
Résolu
le_joker_fou
Messages postés
765
Date d'inscription
Statut
Membre
Dernière intervention
-
le_joker_fou Messages postés 765 Date d'inscription Statut Membre Dernière intervention -
le_joker_fou Messages postés 765 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Timeout dans une boucle - PhP
- Romaco timeout - Télécharger - Contrôle parental
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Boucle excel sans macro - Forum Excel
- Php alert ✓ - Forum PHP
1 réponse
C'est bon j'ai trouvé. Pour ce que ça intéresse voilà comment j'ai fait :
$fp = fopen("mon_script.php","r");
if (!$fp)
{
echo "Impossible d'ouvrir\n";
}
else
{
//timeout de 4 seconde
$out = time()+4;
while(!feof($fp))
{
//si time = ou sup à timeout je sors
if($out<time()) break;
else $res .= htmlentities(fread($fp, 2000));
}
fclose($fp);
}
$fp = fopen("mon_script.php","r");
if (!$fp)
{
echo "Impossible d'ouvrir\n";
}
else
{
//timeout de 4 seconde
$out = time()+4;
while(!feof($fp))
{
//si time = ou sup à timeout je sors
if($out<time()) break;
else $res .= htmlentities(fread($fp, 2000));
}
fclose($fp);
}