什么意思,你到底要替换什么
把这个 style="text-decoration: none" 去掉?
$str = "xxxx";
echo preg_replace("/style=.+?['|\"]/",'title="xxxx"',$str);
这样呢?
$str = 'xxxx';
preg_replace('/style=\".+?\"/','title="XXXXX"',$str);
--------------------------------------------------------------------
补充:'title="XXXXX"' 替换成变量就行了
preg_replace('/style=\".+?\"/','title="'.$Title.'"',$str);
$href = preg_replace('/style="(.+?)">(.+?)','title="\2">\2<',$href);