Variable Replacement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey guys, I'm coding a forum right now and I just decided that I needed to code some variable replacement to create a simple template system. This is the code I have but it doesn't work

   ------------------------------------------------------------------------
   |<?php
   $tpl = file <http://php.net/file>("tpl/head.tpl");
   $code = str_replace
   <http://php.net/str_replace>("{sitename}",$config['sitename'],$tpl);
   foreach ($code as $codeline) {
     print <http://php.net/print>($codeline);
   }
   ?>|
   ------------------------------------------------------------------------

This simply results in a mess, with only the pictures showing up on my page... I know this code is horrible but I have no idea how to go about doing this. I've never worked with reading files and whatnot before

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux