Bonjour a tous,
je voudrais savoir si c'est possible de creer un format de texte comme celui ci avec le php seulement ?
Comprenant les corchets les saut de lignes et l'indentation.

J'ai pensé un peu au domXml php mais je ne connais pas encore cela suffisament.

Je l'ai mis sous balise code afin que l'indentation fonctionne.

Voici a quoi doit ressembler le fichier texte, une fois crée (tous les crochets sont a 3 clic du bord, et les caracteres a 6 clic du bord du fichier a creer) :
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
98
99
100
101
				Battle order generated with ESTH 1.0
 
Nb nations:1
liste d'armee:France
 
nom:BONAPARTE
type:21 1 0
 
[
   nom:Destaing
   type:20 1 0
 
   [
      nom:75 line De
      type:2 1 0
 
      nom:4 light De 
      type:5 1 0
 
      nom:61/1 line De
      type:2 1 0
 
      nom:61/2 line De 
      type:2 1 0
 
   ]
   nom:Lanusse
   type:20 1 0
 
   [
      nom:18/1 line La
      type:2 1 0
 
      nom:18/2 line La
      type:2 1 0
 
      nom:32/1 line La
      type:2 1 0
 
      nom:32/2 line La
      type:2 1 0
 
   ]
   nom:Lannes
   type:20 1 0
 
   [
      nom:22/1 light Lan 
      type:2 1 0
 
      nom:22/2 light Lan
      type:2 1 0
 
      nom:13/1 line Lan
      type:2 1 0
 
      nom:13/2 line Lan
      type:2 1 0
 
      nom:69/1 line Lan 
      type:2 1 0
 
      nom:69/2 line Lan
      type:2 1 0
 
      nom:Foot art. Lan
      type:14 1 0
 
   ]
   nom:Murat
   type:20 1 0
 
   [
      nom:Guides Mu
      type:8 1 0
 
      nom:22 jagers Mu
      type:11 1 0
 
      nom:7bis hussars Mu 
      type:11 1 0
 
      nom:3° dragoons Mu
      type:8 1 0
 
      nom:14° dragoons Mu
      type:8 1 0
 
   ]
   nom:Ruty
   type:20 1 0
 
   [
      nom:Foot art. 1 Ru
      type:14 1 0
 
      nom:Foot art. 2 Ru
      type:14 1 0
 
   ]
]