Re: Newbie: ereg

From: Date: Mon, 25 Nov 2002 17:50:07 +0000
Subject: Re: Newbie: ereg
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125961@lists.php.net to get a copy of this message
I still havent found a site that shows what I need. I dont think php.net explain how ereg works. I only want to publish stuff from the stringvariable $text thats inside tags looking like this <FONT COLOR="#8f8f15">This shall be visible</FONT> or <FONT COLOR="#007f7f">This shall be visible too</FONT> thanks Martin
Try the following: <?php function format_text($text){ $text = ereg_replace("(<[^>]+>)([^<]+)(</[^>]+>)",'\\2',$text); return $text; } print format_text('<FONT COLOR="#8f8f15">This shall be visible</FONT>.'); ?> -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/

« previous php.general (#125961) next »