Scott --

...and then Scott Ware said...
% 
% I'm new to the list, and I don't want this to sound like a stupid ?, but
% I am having an issue with a function that I created.

No problem!


% 
% I have some code stored in a database, similar to XML-style tags, but I
% just created them myself to be more "user-friendly" to people.
% Like for instance <bold></bold>, and <red></red> (would make the text
% red).

Nice of you :-)


% 
% I created a function, to search on the tags that I made, and replace
% them with the appropriate HTML ones, here is my function:
[snip]

Why, that looks almost exactly an example in the preg_replace() section
of the manual :-)  Have a read again.


%       for($i = 0; $i <= 31; $i++)
%       {
%               eregi_replace($search[$i], $replace[$i], $content);
%       }
% 
%       return $content;
% }

Try something like

  $content = preg_replace($search,$replace,$content) ;

and enjoy.


% 
...
% "$row_mysql_table['content']" output. Am I on the right track? And if
% not, can anyone tell me how to accomplish this?

The right track, I think, but don't bother with the loop.


% 
% Thanks!


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to