Using html-style tags to define a variable
| From: | Kevin Keeler | Date: | Wed, 26 Dec 2001 01:20:37 +0000 |
| Subject: | Using html-style tags to define a variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78746@lists.php.net to get a copy of this message | ||
I recall seeing a thread along these lines previously, but the search
functionality at lists.php.net is currently offline, and try as I might
to save messages that may prove useful to me in the future, I cannot get
them all.
So I apologize that this may be found elsewhere, or may be rehash for most
of you.
That given, I'm looking for the ability (using regex, i'm sure) to put
something like <foo>booger</foo> into a database (via a form), and have it
translate to $foo="booger" when php sucks it back out.
the eventual use of this will allow me to type something like:
that's very <m-w>tenacious</m-w> of you ...
and have the end output be ereg_replaced (or such) to:
that's very <a
href=http://www.m-w.com/cgi-bin/dictionary?va=tenacious>tenacious</a>
of
you ...
so i need to take whatever is within the <mw> tag, define that as
$word, and then replace the whole string (tags and word) with:
<a href="http://www.m-w.com/cgi-bin/dictionary?va=$word>$word</a>
follow me?
a simple answer will do, or a point towards an appropriate turorial may
serve me better in the long run
thanks in advance
--kevin