Help with ereg

From: Date: Tue, 11 Mar 2003 12:33:58 +0000
Subject: Help with ereg
Groups: php.windows 
Request: Send a blank email to php-windows+get-18966@lists.php.net to get a copy of this message
Hi all. I'm trying to deal with Regular Expressions, but somehow it is getting more difficult. I´m trying to do the folowing: Read a text and get all of the PHP code out of it, highlight it and then print all in nice HTML. I'm using this to get the PHP code: ereg("<\?.*\?>",$Text,$PHP_code); It works, yeah, but on a situation like this: <? echo "aaaa"; ?> This is some other no php code <? echo "this is PHP"; ?>

« previous php.windows (#18966) next »