如何使用PHP遍历Vimeo API

时间:2018-07-19 15:25:38

标签: php laravel vimeo-api

如何遍历此数组并显示视频的所有标题?

{{dd($ films)}}

的结果
array:3 [▼
  "body" => array:5 [▼
    "total" => 597
    "page" => 1
    "per_page" => 10
    "paging" => array:4 [▶]
    "data" => array:10 [▼
      0 => array:30 [▼
        "uri" => "/videos/280174677"
        "name" => "_DLA P_4093_GPC_French Lunchtime Partners film_180716_BN"
        "description" => null
        "link" => "https://vimeo.com/280174677"
        "transcode" => array:1 [▶]
      ]
      1 => array:30 [▶]
      2 => array:30 [▶]
      3 => array:30 [▶]
      4 => array:30 [▶]
      5 => array:30 [▶]

1 个答案:

答案 0 :(得分:0)

执行以下操作:

@foreach ($films['data'] as $film) 
      {{ $film['name'] }}
@endforeach