php多维数组删除指定元素,php – 根据值从多维数组中删除元素

我试图从基于值的多维数组中删除元素。在这种情况下,如果子数组的键’year’的值为2011,我想要该子数组。

只是为了纪录:我运行PHP 5.2。

我的数组看起来像这样:

Array

(

[0] => Array

(

[filmId] => 61359

[url] => http://www.moviemeter.nl/film/61359

[title] => Unstoppable

[alternative_title] =>

[year] => 2011

[thumbnail] => http://www.moviemeter.nl/images/covers/thumbs/61000/61359.jpg

[average] => 0

[votes_count] => 0

[similarity] => 100.00

[directors_text] => geregisseerd door Richard Harrison

[actors_text] => met Chen Shilony, Ruben Crow en David Powell

[genres_text] => Drama / Komedie

[duration] => 90

)

[1] => Array

(

[filmId] => 87923

[url] => http://www.moviemeter.nl/film/87923

[title] => Unstoppable

[alternative_title] =>

[year] => 2011

[thumbnail] => http://www.moviemeter.nl/images/covers/thumbs/87000/87923.jpg

[average] => 0

[votes_count] => 0

[similarity] => 100.00

[directors_text] => geregisseerd door Example Director

[actors_text] => met Actor 1, Actor 2 en Actor 3

[genres_text] => Drama / Komedie

[duration] => 90

)

[2] => Array

(

[filmId] => 68593

[url] => http://www.moviemeter.nl/film/68593

[title] => Unstoppable

[alternative_title] =>

[year] => 2010

[thumbnail] => http://www.moviemeter.nl/images/covers/thumbs/68000/68593.jpg

[average] => 3.3

[votes_count] => 191

[similarity] => 100.00

[directors_text] => geregisseerd door Tony Scott

[actors_text] => met Denzel Washington, Chris Pine en Rosario Dawson

[genres_text] => Actie / Thriller

[duration] => 98

)

[3] => Array

(

[filmId] => 17931

[url] => http://www.moviemeter.nl/film/17931

[title] => Unstoppable

[alternative_title] => Nine Lives

[year] => 2004

[thumbnail] => http://www.moviemeter.nl/images/covers/thumbs/17000/17931.jpg

[average] => 2.64

[votes_count] => 237

[similarity] => 100.00

[directors_text] => geregisseerd door David Carson

[actors_text] => met Wesley Snipes, Jacqueline Obradors en Mark Sheppard

[genres_text] => Actie / Thriller

[duration] => 96

)

)

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 1024 设计师:白松林 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值