Home >Backend Development >PHP Tutorial >请问各位大神一个正则问题

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:09:31824browse

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


回复讨论(解决方案)

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn