Hallo,
ik ben bezig met blocks.
html code
php
broncode output
Hij haalt die block dus weg wat in die ene block zit.
Iemand enig idee hoe dit kan?
Alvast bedankt.
Groetjes stef
ik ben bezig met blocks.
html code
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| <html> <head> <title>{title}</title> </head> <body> {inhoud}<br> <!-- START BLOCK test -->hahah<br><!-- START BLOCK blaat -->grapjas<!-- EINDE BLOCK blaat --><!-- EINDE BLOCK test --> </body> </html> |
php
PHP:
1
2
3
4
5
6
7
8
9
10
11
| function Block ( $naam ) { if ( preg_match ( '/<!-- (START|EINDE) BLOCK ' . $naam . ' -->(.*?)<!-- (START|EINDE) BLOCK ' . $naam . ' -->/si', $this->inhoud, $matches ) ) { echo 'Jahoor<br>'; } else { echo 'Nee<br>' ; } } |
broncode output
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| Jahoor<br>Nee<br><html> <head> <title>Parser!</title> </head> <body> :P <!-- START BLOCK test -->hahah<!-- EINDE BLOCK test --> </body> </html> |
Hij haalt die block dus weg wat in die ene block zit.
Iemand enig idee hoe dit kan?
Alvast bedankt.
Groetjes stef