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

  • SEARCH
  • Home
  • 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 8193537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:30:39+00:00 2026-06-07T04:30:39+00:00

I have my data in ArrayObject , simply representing an array. I need to

  • 0

I have my data in ArrayObject, simply representing an array. I need to filter the data, function array_filter() would work great. However, it does not work with ArrayObject as argument. What’s the best way to treat with this? Is there any standard function which handles filtering for me?

Example:

$my_data = ArrayObject(array(1,2,3));
$result = array_object_filter($my_data, function($item) { return $item !== 2; });

Is there any array_object_filter function?

  • 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-06-07T04:30:41+00:00Added an answer on June 7, 2026 at 4:30 am

    How about you export it to an actual array, and then create a new Array Object?

    $my_data = new ArrayObject(array(1,2,3));
    $result = new ArrayObject( 
        array_filter( (array) $my_data, function($item) { 
             return $item !== 2; 
        })
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data from two different sources that I need to combine. Some data
I have data with no relation. Just need to count various columns from 3
This is my array: ArrayObject::__set_state( array( 'data' => array ( 'key1' => '573779', 'key2'
I have next code block: $.post('page.php', function(data) { //data - full page info });
I have a function which needs to return either an array or object. I'm
I have Data.cpp Data.h User.cpp User.h main.cpp Main.cpp need data.cpp and user.cpp. How do
I have data tables (d1 and d2) which I would like to print side
I have 2 files. 1: json.php; <?php $data = array( (object)array( 'oV' => 'myfirstvalue',
I need some help, I have created this function and it works fine, but
If I have an array of data, what is the best option for sorting

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.