Bonjour à tous.
Je récupère des texarea provenant d'une BDD sql ( $area[$a] )
Je calcul le nombre de lignes ( je dois décortiquer le texte pour calculer des coordonnée xy pour fpdf , d'où les " this -> ")
Il suffit de deux tours dans la boucle, pour avoir une erreur dans le tableau !!:calim2:
j'ai mis des echo partout mais ça ne m'en dit pas plus..
Ca fait deux jour que je cherche, je m'en remet à vous !:pleure:
est-ce que vous auriez une idée ??
Pour les erreurs , avec l'affichage de mes 'echo':Code:
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 $nbr_lgnF=0; $nombre_lgn=array(); for ($a=1;$a<6;$a++){ if ($area[$a]=="") { $a=7; } else { $texte=nl2br($area[$a]);// pour afficher les <br /> $nbr_lgnx=substr_count($texte,'<br />')+1;// et pour compter les <br /> echo 'nombre de lignes : '. $nbr_lgnx ; echo '<br>nombre de lignes x 3 : '. $nbr_lgnx*3 ; ligne 176>>> $nombre_lgn[$a]=$nbr_lgnx*3; echo '<br>nombre_lgn[$a] : '.$nombre_lgn[$a].'<br><br>'; for ($x=1;$x<6;$x++) { if (!isset($nombre_lgn[$x-$x])) { ligne 185>>> $nombre_lgn[$x-$x]=0; echo 'nombre-lgn[$x-$x] : '.$nombre_lgn[$x-$x]; } } $nbr_lgnF += $nombre_lgn[$a]; if ($a == 1) { $esp=0;$nombre_lgn=0;} else {$esp=20; } $pos_y = $nombre_lgn[$a] + 92 + $esp; $this-> setXY(12,$pos_y); $this->Multicell(125,3,$area[$a],0); } }
Code:
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 Tour de boucle : 1 nombre de lignes : 7 nombre de lignes x 3 : 21 nombre_lgn[$a] : 21 nombre-lgn[$x-$x] : 0 Tour de boucle : 2 nombre de lignes : 5 nombre de lignes x 3 : 15 Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 176 nombre_lgn[$a] : Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 185 nombre-lgn[$x-$x] : Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 185 nombre-lgn[$x-$x] : Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 185 nombre-lgn[$x-$x] : Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 185 nombre-lgn[$x-$x] : Warning: Cannot use a scalar value as an array in E:\wamp\www\gestion_ai\Consult_fiche.fact.pdf.php on line 185 nombre-lgn[$x-$x] :
