一些逃避的工作有些不起作用

时间:2014-12-07 09:45:31

标签: php preg-replace eregi

对于PHP,我是一个新手,我的服务器已经升级到php 5.3,因此我的脚本被弃用了代码错误。我在某些地方使用eregi_replace并尝试更改为preg_replace但是遇到了分隔符错误,有人可以帮忙吗?我添加了一些分隔符,前两行似乎工作正常,但随后的行会出现错误,例如lissing括号...等等

这里有几个样本行,我现在遇到问题,因为我已经从eregi更改为preg。

$VBText=preg_replace('/"/','"',$VBText);
$VBText=preg_replace('/&/','&',$VBText);
$x=preg_replace('/)/',' ) ',$x);
$x=preg_replace('/\(/',' ( ',$x);
$x=preg_replace('/,/',' , ',$x);
$x=preg_replace('/=/',' = ',$x);
$x=preg_replace('/ if /',' <font color="blue">If</font> ',$x);
$x=preg_replace('/ #if /',' <font color="blue">#If</font> ',$x);
//check for Dim
$x=preg_replace('/ dim /',' <font color="blue">Dim</font> ',$x);
//on error resume next
$x=preg_replace('/ on error resume next /',' <font color="blue">On Error Resume Next</font> ',$x);
//next
$x=preg_replace('/ next /',' <font color="blue">Next</font> ',$x);
//end with

我有成千上万行,所以如果有人可以帮助解决上述问题,我相信我可以管理其余部分:)

0 个答案:

没有答案