使用preg_match提取数据

时间:2014-09-23 12:32:59

标签: preg-match capture

我有这个字符串:

8d25a8dfdf46": { "file": "images\/slide\/s1.jpg", "title": "", "link"

我想抓拍:

从这里开始:

"file": "capture inside this quotes"

达到最终报价

提前致谢!

注意:我的字符串有更多数据,我只是放了一部分。

1 个答案:

答案 0 :(得分:1)

使用:

preg_match('/"file": "([^"]*)"/', $string, $match);

$match[0]将包含整个匹配,$match[1]将包含图片网址。

相关问题