当前位置:Gxlcms > PHP教程 > 请问各位大神一个正则问题

请问各位大神一个正则问题

时间:2021-07-01 10:21:17 帮助过:3人阅读

$str = '[[{"id":"","url":"","title":""xxxxxxxxxxxxxxxxxxxxxxx"","thumb":"","description":"","color":"","size":"14px"}]]';
先需要"title":" 开头 以","thumb" 结尾 替换"xxxxxxxxxxxxxxxxxxxxxxx" 为 \"xxxxxxxxxxxxxxxxxxxxxxx\" 请大神们指导指导


回复讨论(解决方案)

看看是不是你想要的结果
preg_replace("/title\":\"\"(.*)\"\",\"thumb/i","title:\"\\\"\\1\\\"\",\"thumb",$str);

人气教程排行