繁体   English   中英

如何从图 facebook API 中获取匹配的记录?

[英]How to get the matched records from graph facebook API?

我必须从返回的 facebook api 响应中获取 url 和图像名称。 我有响应结果。 我试图从以下获取图像 url 和图像名称。 请帮我获取位置 url 和图像名称

 preg_match('/Location: (.*?)\n/', $header, $matches);

output:

HTTP/2 302 
x-app-usage: {"call_count":16,"total_cputime":0,"total_time":4}
x-fb-rlafr: 0
location: https://xxxxx.net/v/cccc/cccc/130282202_3518020318246580_4104659942029629494_o.jpg?_nc_cat=104&ccb=2&_nc_sid=9e2e56&_nc_ohc=pErMyD3PYFkAX8b7JiO&_nc_ht=scontent-ort2-1.xx&tp=6&oh=db3843917c53f747c3c3f860ca9144d1&oe=6040C6ED
expires: Sat, 01 Jan 2000 00:00:00 GMT
x-fb-request-id: dddddd
strict-transport-security: max-age=15552000; preload
x-fb-trace-id: dddddd
facebook-api-version: v3.2
content-type: image/jpeg
x-fb-rev: 1003270116
cache-control: private, no-cache, no-store, must-revalidate
pragma: no-cache
access-control-allow-origin: *
x-fb-debug: cvvvvvvvvvvvvvvvvvvvvvvvvvvv
content-length: 0
date: Fri, 05 Feb 2021 06:41:05 GMT
alt-svc: h3-29=":443"; ma=3600,h3-27=":443"; ma=3600



        $img_array[$key]['url'] = trim(substr($matches['0'],10)); // to get the location url
       // print_r($img_array[$key]['url']);
        
        $img_array[$key]['name'] = substr($b['name'],0,-16); // to get the image name

preg_match('/location: (.*?)\n/', $header, $matches);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM