标签:array com lan reg ace color replace log eva
$aa = "{1}*{2}-{3}"; $farr = array(‘/\{1\}/‘,‘/\{2\}/‘,‘/\{3\}/‘); $tarr = array(3,4,10); $str = preg_replace( $farr,$tarr,$aa); echo $str; //结果:3*4-10 echo eval(‘return ‘.$str.‘;‘); //结果:2
来源:http://blog.51yip.com/php/1846.html
标签:array com lan reg ace color replace log eva
原文地址:http://www.cnblogs.com/wuheng1991/p/6923214.html