Re: Use variables, functions ect. in a textfile

From: Date: Wed, 24 Jan 2001 13:36:26 +0000
Subject: Re: Use variables, functions ect. in a textfile
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-36410@lists.php.net to get a copy of this message
>Im working on a site where we want to put all the text into text-files. Im having troubles doing this, though. If I have a text like this "Today there are more than XXXX users registered", and I put it in a .txt-file, how can I execute the code wich should return the numer XXXX? Im building functions for all returns from databases. > >XXXX could be something like <?PHP echo countMembers() ?>. > >The .txt-file is builde like this: > >"[H]Welcome[/H][S]Welcome to this site. We are proud to introduce you to more than[C] echo countMembers[/C][/S][S]>Please enjoy your stay.[S]" > >Where [S] meaning start/end text and [C] start/end code. > >The reason why I want to do it this way are that someone without any HTML/PHP-skills should be able to edit the text and it would be much easier to build a site in different languages. > >Im open to other ways of doing it. $text = str_replace("[C]", 42, $text); Since you have just described the basic functionality of PHPlib, FastTemplate, and about forty 'leven other Templates systems, I have to suggest that you check them out before building YetAnotherTemplate. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#36410) next »