簡體   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