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 4618980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:21:45+00:00 2026-05-22T02:21:45+00:00

I have deleted the old post to make this more clear. I have 2

  • 0

I have deleted the old post to make this more clear. I have 2 arrays that I need to compare and match but only if 2 values per array are the same.

$array1 = $plugins
$array2 = $xml_dump

A sample of what both arrays look like:

$plugins 

Array
(
    [all] => Array
        (
            [ajax-category-dropdown/dhat-ajax-cat-dropdown.php] => Array
                (
                    [Name] => Ajax Category Dropdown
                    [PluginURI] => http://www.example.com/ajax/
                    [Version] => 0.1.5
                    [Description] => Generates multi-level ajax. 
                    [Author] => DyasonHat
                    [AuthorURI] => http://www.dyasonhat.com
                    [Title] => Ajax Category Dropdown
                    [AuthorName] => Dya
                )

            [akismet/akismet.php] => Array
                (
                    [Name] => Akismet
                    [PluginURI] => http://akismet.com/
                    [Version] => 2.5.3
                    [Description] => Used by millions
                    [Author] => Automattic
                    [AuthorURI] => http://automattic.com/
                    [Title] => Akismet
                    [AuthorName] => Automattic
                )


$xml_dump
SimpleXMLElement Object
(
    [plugin] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [name] => Ajax Category Dropdown
                    [ex_version] => 0.1.5
                    [ex_date] => 2008-01-03
                    [plugin_url] => http://wordpress.org/extend/plugins/wp-contactform/
                    [advisory_url] => http://osvdb.org/show/osvdb/43284
                )

            [1] => SimpleXMLElement Object
                (
                    [name] => WP-ContactForm
                    [ex_version] => 2.0.7
                    [ex_date] => 2008-01-03
                    [plugin_url] => http://wordpress.org/extend/plugins/wp-contactform/
                    [advisory_url] => http://osvdb.org/show/osvdb/43284
                )

            [2] => SimpleXMLElement Object
                (
                    [name] => Math Comment Spam Protection
                    [ex_version] => 2.1
                    [ex_date] => 2008-01-03
                    [plugin_url] => http://wordpress.org/extend/plugins/math-comment-spam-protection/
                    [advisory_url] => a
                )

I need it to return the value ( or return true) only if $array1 Name , Version matches $array2 name ,ex_version

In the example above you can see that

$array1
Name => Ajax Category Dropdown
Version => 0.1.5

///has a match in 

$array2
name => Ajax Category Dropdown
ex_version => 0.1.5

I have tried many variations of array_intersect but I cannot get it to match 2 values for each array.

  • 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-22T02:21:45+00:00Added an answer on May 22, 2026 at 2:21 am

    Just wanted to close this with what ended up being my solution.

    I grab the Name and Version for both arrays and created a new array for each one, that way I could easily use array_intersect and manipulate they arrays. So to get this to work I just needed to create two new arrays with the values I wanted to compare.

     $a = array();
     $b = array();
    
     //first foreach loop
    
     $find_local_plugs = $global_plugins_name . $plugin_version;
     $a[] = $find_local_plugs;
    
     //second foreach loop
    
     $find_remote_plugs = $xml_plugins . $xml_plugin_version;
     $b[] = $find_remote_plugs;
    
    
     $matches = array_intersect($a, $b);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've deleted the old post here. I have a contentEditable div. If you paste
I have a SQL Server 2005 database that has been deleted, and I need
I have a table that looks like this: ╔════╦═════════╦═════════╦═══════╗ ║ id ║ deleted ║
I have a grideview that displays rows that will be deleted across servers by
I have a live database that had some data deleted from it and I
I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0;
If I have a development area that I deleted files from a certain folder/directory,
I have running process but it's executable file has got deleted. If I try
This is related to post: Server displays old version of site To repeat the
We have TRAC 0.11 server. Unfortunately we have deleted a milestone in one of

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.