Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:13:51+00:00 2026-05-29T05:13:51+00:00

I am trying to edit a plugin that is fetching a multidimensional array, then

  • 0

I am trying to edit a plugin that is fetching a multidimensional array, then breaking it out into a foreach statement and doing stuff with the resulting data.

What I am trying to do is edit the array before it gets to the foreach statement. I want to look and see if there is a key/value combination that exists, and if it does remove that entire subarray, then reform the array and pass it to a new variable.

The current variable

$arrayslides 

returns several subarrays that look like something like this (I remove unimportant variables for the sake of briefness):

Array ( 
  [0] => Array ( 
    [slide_active] => 1 
  ) 
  [1] => Array ( 
    [slide_active] => 0 
  )
) 

What I want to do is look and see if one of these subarrays contains the key slide_active with a value of 0. If it contains a value of zero, I want to dump the whole subarray altogether, then reform the multidimensional array back into the variable

$arrayslides 

I have tried a few array functions but have not had any luck. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:13:52+00:00Added an answer on May 29, 2026 at 5:13 am
    $arrayslides = array(0 => array (  'slide_active' => 1, 'other_data' => "Mark" ),
                         1 => array (  'slide_active' => 0, 'other_data' => "ABCDE"  ),
                         2 => array (  'slide_active' => 1, 'other_data' => "Baker"  ),
                         3 => array (  'slide_active' => 0, 'other_data' => "FGHIJ"  ),
                        );
    
    
    $matches = array_filter($arrayslides, function($item) { return $item['slide_active'] == 1; } );
    
    var_dump($matches);
    

    PHP >= 5.3.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to edit the jqChart plugin so that chart tooltips are displayed while
Im trying to write a quick plugin that will load some AJAX content into
weird question. I'm trying to extend a little plugin that's in my blog's sidebar.
I am trying to animate my #main div so that it fades out and
I'm trying to build a jQuery plugin that filters the provided jQuery object to
There's a jQuery plugin out there that puts a dragable bar that lets you
Using jQuery's qtip plugin, I'm trying to display hidden value (that's already rendered wher
I am trying out m2eclipse , the Eclipse plugin for Maven, and have noticed
I'm trying to make something like plugin that outputs certain text when Qt creator
I'm trying to edit the output joomla main_menu module so I can make a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.