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

WBOY
Release: 2016-06-23 14:09:31
Original
761 people have browsed it

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


回复讨论(解决方案)

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template