Je suis présentement à l'élaboration d'un petit moteur de view qui vas se baser sur le principe des placeholder en asp. Problème par contre c'Est que j'arrive pas à isoler tous les éléments ...
et le dump me donne ceci:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <?php $string = "<Fx:PlaceHolder ID=\"machin\"><title 123></Fx:PlaceHolder>"; $string .= "<Fx:PlaceHolder ID=\"marchin2\"><title 123></Fx:PlaceHolder>"; $string .= "<Fx:PlaceHolder ID=\"marchin3\"><title 123></Fx:PlaceHolder>"; preg_match_all('/((<Fx:PlaceHolder ID=")([a-zA-Z0-9_-]+)(">)(.+)(<\/Fx:PlaceHolder>)+)/', $string, $placeholders); var_dump($placeholders); ?>
Bref ici je cherche à avoir ce que contiens ID et ce qui se trouve à l'intérieur de <Fx
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 array(7) { [0]=> array(1) { [0]=> string(172) "<Fx:PlaceHolder ID="machin"><title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin2"><title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin3"><title 123></Fx:PlaceHolder>" } [1]=> array(1) { [0]=> string(172) "<Fx:PlaceHolder ID="machin"><title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin2"><title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin3"><title 123></Fx:PlaceHolder>" } [2]=> array(1) { [0]=> string(20) "<Fx:PlaceHolder ID="" } [3]=> array(1) { [0]=> string(6) "machin" } [4]=> array(1) { [0]=> string(2) "">" } [5]=> array(1) { [0]=> string(127) "<title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin2"><title 123></Fx:PlaceHolder><Fx:PlaceHolder ID="marchin3"><title 123>" } [6]=> array(1) { [0]=> string(17) "</Fx:PlaceHolder>" }laceHolder></Fx
laceHolder> en considérant que ce qui s'y trouve peut être du html ou tout texte.
J'avoue que je sèche un peu là :/
}

Répondre avec citation






Partager