您好,欢迎访问一九零五行业门户网

为何不能对正则匹配的值进行大写转换呢

为什么不能对正则匹配的值进行大写转换呢?
function syntax_color_sql($string)
{
$pattern='#select|left join|having|union|from|right join|limit|where|order by|for lock#sui';
return preg_replace($pattern, ''.strtoupper('$0').'', $string);
}
------解决方案--------------------
本帖最后由 xuzuning 于 2013-01-25 12:38:54 编辑     $pattern='#select
------解决方案--------------------
left join
------解决方案--------------------
having
------解决方案--------------------
union
------解决方案--------------------
from
------解决方案--------------------
right join
------解决方案--------------------
limit
------解决方案--------------------
where
------解决方案--------------------
order by
------解决方案--------------------
for lock#suie';
    return preg_replace($pattern, '.strtoupper($0).', $string);
其它类似信息

推荐信息