Bonjour,
Je me retrouve face à un problème d'optimisation de mon script.
Je veux vérifier si mon fichier ne contient absolument aucun identifiant!!

Jusqu'ici je ne m'étais jamais retrouvé avec ce cas de figure, une suffisament impotante pour avoir le message "Maximum execution time of 30 seconds"

Pourriez-vous m'aider à optimiser mon script
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
	case "description":
		$file = fopen("../tmp/derniersResultats.txt", "r") or die("<strong>Can not open file </strong>");	
 
		if ($file) {
		$cmpt=0;
		$empty="";
			while (!feof($file)) {
			$cmpt++;
			$empty=$empty.fgets($file, 4096); 
			}	
		}
		fclose($file);
 
		$_SESSION['CMPT'] = $cmpt - 1;
 
		if ($empty==""){
			$_SESSION['ERROR'] = ('Your set is empty,<br> please type in an other request');
			header("location:../pages/acceuil2.php") or die("Can not go to the home page");
		}
		else get_description("../tmp/derniersResultats.txt") or die("Can not go to the right path" );
	break;