Re: How to write a simple parser?
| From: | Jason | Date: | Tue, 28 Nov 2000 00:26:34 +0000 |
| Subject: | Re: How to write a simple parser? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27517@lists.php.net to get a copy of this message | ||
On Mon, Nov 27, 2000 at 07:06:44PM -0800, rodrigo wrote:
> I neeed to write a simple parser that will interpret simple commands and
> convert them to HTML. The command tags start and end with square
> brackets "[]". For example, if someone where to type
> "[link:www.locatio.com | locatio]" then that would translate into "<a
> href="www.locatio.com">locatio</a>".
If you plan on growing your parser to anything significant, you might want
to take a look at PHP's XML support. XML is really useful for config file
type stuff, and is becoming more and more widespread.
But if all you want to do is your one example, it'd be overkill.
read all about it at http://www.php.net/manual/ref.xml.php