ID: 24818 Updated by: [EMAIL PROTECTED] Reported By: springchun at 21cn dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: linux PHP Version: 4.3.1 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. not a PHP bug. Previous Comments: ------------------------------------------------------------------------ [2003-07-26 08:07:22] springchun at 21cn dot com Description: ------------ This is best php template than Smarty,FastTemplate and PHPLIB Template; Is it add this function into php5.0.dll? please seen 'http://www.cqlc.net/document.txt'; function cqlctpl($file) { $fp=fopen($file,"r"); $msg="echo\"".str_replace("\"","\\\"",fread($fp,filesize($file)))."\";"; fclose($fp); $oldstr=array(0=>"/\{loop:([^\}]+)\}(.+)\{\/loop\}/si", 1=>"/\{logi:([^\}]+)\}(.+)\{\/logi\}/si", 2=>"/\{exec:([^\}]+)\}/si", 3=>"/(\{\*[^\*]+\*\})/si" ); $newstr=array(0=>"\";\\1{echo\"\\2\";}echo\"", 1=>"\";\\1{echo\"\\2\";}echo\"", 2=>"\";\\1;echo\"", 3=>"" ); return preg_replace($oldstr,$newstr,$msg); } Reproduce code: --------------- <? function cqlctpl($file) { $fp=fopen($file,"r"); $msg="echo\"".str_replace("\"","\\\"",fread($fp,filesize($file)))."\";"; fclose($fp); $oldstr=array(0=>"/\{loop:([^\}]+)\}(.+)\{\/loop\}/si", 1=>"/\{logi:([^\}]+)\}(.+)\{\/logi\}/si", 2=>"/\{exec:([^\}]+)\}/si", 3=>"/(\{\*[^\*]+\*\})/si" ); $newstr=array(0=>"\";\\1{echo\"\\2\";}echo\"", 1=>"\";\\1{echo\"\\2\";}echo\"", 2=>"\";\\1;echo\"", 3=>"" ); return preg_replace($oldstr,$newstr,$msg); } function test(){echo"<p>this is 2.tml ,welcome you";} $title="this is a tml"; $body="this out "; for($i=0;$i<10;$i++)$array[$i]="hello world $i"; eval(cqlctpl("1.txt")); Expected result: ---------------- this is a tml (1.tml) this out is hello world 0 this out is hello world 1 this out is hello world 2 this out is hello world 3 this out is hello world 4 this out is hello world 5 this out is hello world 6 6 is biger than 5 this out is hello world 7 7 is biger than 5 this out is hello world 8 8 is biger than 5 this out is hello world 9 9 is biger than 5 time is 1059193623 this is other tml(2.tml) this is 2.tml ,welcome you Actual result: -------------- this is a tml (1.tml) this out is hello world 0 this out is hello world 1 this out is hello world 2 this out is hello world 3 this out is hello world 4 this out is hello world 5 this out is hello world 6 6 is biger than 5 this out is hello world 7 7 is biger than 5 this out is hello world 8 8 is biger than 5 this out is hello world 9 9 is biger than 5 time is 1059193623 this is other tml(2.tml) this is 2.tml ,welcome you ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24818&edit=1