WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   ereg in preg umwandeln (http://www.wcm.at/forum/showthread.php?t=100753)

pong 24.06.2003 20:18

ereg in preg umwandeln
 
Code:

$msg = ereg_replace("\<(.*)\>", "", $msg);
wie wandel ich den in einen preg konfornem Ausdruck um? Die Funktion soll die gleiche bleiben, sprich alle HTML tags sollen rausgefiltert werden

pong

_m3 24.06.2003 20:21

Damit filterst du nicht alle HTML-Tags aus.

pong 24.06.2003 21:12

Zitat:

Original geschrieben von _m3
Damit filterst du nicht alle HTML-Tags aus.
sondern?

pong

sagi 24.06.2003 22:18

PHP-Code:

$msg ereg_replace("\<(.*)\>"""$msg); 

...

versuch:


PHP-Code:

$msg preg_replace("'<[\/\!]*?[^<>]*?>'si"""$msg); 

mfg

c.

http://at.php.net/manual/en/function.preg-replace.php

_m3 24.06.2003 22:37

Zitat:

Original geschrieben von pong


sondern?

pong

Texttext2Text3</p>
=>
ereg_replace("\<(.*)\>", "", $msg);
=>
Texttext2Text3

pong 24.06.2003 22:52

danke sagi

@_m3 danke dass du mir eine Schwachstelle aufgezeigt hast, welche ich noch nicht bemerkt habe

pong


Alle Zeitangaben in WEZ +2. Es ist jetzt 16:43 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag