bonsoir,
je vous fait par d'une erreur que je ne comprends pas.
J'ai un fichier index.php et je souhaite connaitre le nombre de lignes de ce fichier. Voilà comment je procède:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
$ligneIndex = file('test.php');
echo count($ligneIndex);
Je vous écris le fichier afin que vous puissiez tester chez vous:
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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
 
<?
session_start();
include ("./include.php");
 
if($_SESSION['login']!=null && $_SESSION['password']!=null && $_SESSION['role']!=null )
{
    if($_SESSION['role']=="Ca")
        $util = new candidat($_SESSION['login'],$_SESSION['password'],$_SESSION['role'],$_SESSION['site'],$_SESSION['id_connexion'],$_SESSION['nom'],$_SESSION['prenom'],$_SESSION['dossier']);
    else if($_SESSION['role']=="Tp")
        $util = new tiers($_SESSION['login'],$_SESSION['password'],$_SESSION['role'],$_SESSION['site'],$_SESSION['id_connexion'],$_SESSION['nom'],$_SESSION['prenom'],$_SESSION['dossier']);
    else
        $util = new utilisateur($_SESSION['login'],$_SESSION['password'],$_SESSION['role'],$_SESSION['site'],$_SESSION['id_connexion'],$_SESSION['nom'],$_SESSION['prenom']);
 
    $tmp_menu= "menu_".$_SESSION['role'];
    $menu= new $tmp_menu();
}
?>
 
<title>GPI Application</title>
<head>
 
<link href="./style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
 
<?php
  $textes = new TextesMultilingues("textes_LANG.php", $_SESSION['langue']);
?>
 
<div id="haut">
    <div id="gauche_haut">
        <img src="images/logo_alorem.gif" width="150" height="92" /><br>
    </div>
 
    <div id="centre_haut"><?php    
      if($_SESSION['login']==null)
      {
	       echo "<p align=center><form id=log name=loggin method=post action=index.php?page=valid_login>";
	             echo"<table width=200 border=0>"; 
                 echo"<tr>";
		              echo"<td><label> <span class=Style3>". $textes->tmlTexte("form_login")."</span></td>";
    	            echo"<td><span class=Style3><input name=login type=text id=login size=20/> </span></td>";
	               echo"</tr>";
 
	               echo"<tr>";
		              echo"<td><label><span class=Style3>". $textes->tmlTexte("form_passe")."</span></label></td>";
    	            echo"<td><span class=Style3><input name=password type=password id=password size=20/></span></td>";
 	               echo"</tr>";
 
	               echo"<tr><span class=Style3>";
                  echo"<td></td>"; 
                  echo "<td><input type=submit name=Submit value=". $textes->tmlTexte("bouton_connexion")." class=bouton/></span></td>"; 
                 echo"</tr>";
               echo"</table>";
        echo"</form></p>"; 
      }
      else
      {
         include('menu.php');
      }
    ?></div>
 
    <div id="droite_haut">
        <p><?php echo $textes->tmlTexte("choix_langue").":"; ?></p> 
        <p><a href="index.php?langue=fr"><img src="images/fr.jpg" width="29" height="19" border="0"/></a> 
		&nbsp;<a href="index.php?langue=en"><img src="images/en.jpg" width="29" height="19" border="0"/></a>
		<ul>
		</p>
<?php 
     if($_SESSION['login']<>null)
          echo"<p><a href=supr_session.php>".$textes->tmlTexte("deconnexion")."</a>";
?>
    </div>
</div>
 
<div id="contenu">
<?php
 
 
  // On teste que le paramètre d'url existe et qu'il est bien autorisé
  // -----------------------------------------------------------------
  if ( (isset($_GET['page'])) && (isset($pageOK[$_GET['page']])) ) 
  {
    include($pageOK[$_GET['page']]);   // Nous appelons le contenu central de la page
  } 
  else
  {
    include('accueil.php');   // Page par défaut quant elle n'existe pas dans le tableau
  }
 
?>
 
</div>
 
</body>
</html>
le count(file('index.php')) me renvoi 1 (soit 1 ligne) !!!!!!!!!!!!!!!!!!!!

Si vous avez des explications merci de m'en faire part

Merci