SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to parse template file ??

    Hello forums !!
    I have some file named "test.tpl"
    whic has following contents
    "Hello %name% your passwrod is %passwrod%"
    I would like to call this file and replace those values within % with dynamic values(may also {}).
    Any comments and suggestions are warmly welcome.
    Thanks in advance to all of you

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You may use regular expressions (see preg_replace)
    Saul

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Location
    edge of nowhere
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this little class I sketched. It should work for you as an example, and if you need to grow it's a place to start.
    Attached Files Attached Files
    Programming boils down to three things: fast, good and cheap.
    Please pick two.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •