Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- The One Line Template Engine!


IanKelley - 6:09 am on Sep 14, 2007 (gmt 0)


Elegant :-)

Significantly less elegant, and untested, alternate using MySQL for greater efficiency:

list($tpl) = mysql_fetch_row(mysql_query("SELECT tpl FROM templates WHERE page = '$self'",mysql_connect($dbh,$dbu,$dbp)));
print preg_replace("/\{([^\{]{1,100}?)\}/e","$$1",$tpl));

Non Swahili translation of greater efficiency: More pages served before you have to buy more hardware.


Thread source:: http://www.webmasterworld.com/php/3444822.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com