[PHP] Re: Newbie: ereg

2002-11-25 Thread Kyle Gibson
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=#8f8f15This shall be visible/FONT
or
FONT COLOR=#007f7fThis 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=#8f8f15This shall be visible/FONT.');

?



--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Newbie: ereg

2002-11-25 Thread Mattia
I don't know if I got it right bu try

echo htmlentities('FONT COLOR=#8f8f15This shall be visible/FONT');
htmlentities() will translate your string in 'lt;FONT
COLOR=#8f8f15gt;This shall be visiblelt;FONTgt;'

 FONT COLOR=#8f8f15This shall be visible/FONT
 or
 FONT COLOR=#007f7fThis shall be visible too/FONT



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php