> Hi everyone, > > Thanks for your replies. I Think I haven't been very clear about what I > really need. First of all, I don't need an existing templating system, > because I am working on my own templating system. > And regarding Satyam's post. This looks a lot like what I'm developing > right now, but also not my issue =) > > What I really need is a fast lookup mechanism, to 'translate' statements. > > For example: > > setOutputType('xhtml'); > echo(translate('authorstart')); > > the function translate opens xhtml.data, which contains: > > authorstart : <span class="author"> > authorend : </span> So, is you're entire website template going to just look like those keywords??? If you ask me that seems kinda pointless and if anything, just extra overhead for your app > > so, the translate function looks 'authorstart' up and returns '<span > class="author">' > > or if you had specified 'wml' as the outputtype, the file could like like: > > authorstart : <b> > authorend : </b> > > and the function would return '<b>' > > This is all no problem, except that these lists can be pretty big. And I > wouldn't like to load them all into the memory, or have to loop through > the file every time translate is called. > > So I need a very fast mechanism to overcome this problem. If you're deadset on doing this, I would go with a database and str_replace(). str_replace() is always better than a regex solution because it doesn't incur the overhead of the regex engine. Only use regex when you need a complex solution. > Any ideas? > > grt, > Evert -- jamwil.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php