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.
<br>
A sample of what both arrays look like:
I need it to return the value ( or return true) only if $array1
,
matches $array2
,
In the example above you can see that
I have tried many variations of
but I cannot get it to match 2 values for each array.
Code:
$array1 = $plugins
Code:
$array2 = $xml_dump
A sample of what both arrays look like:
Code:
$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
Code:
Name
Code:
Version
Code:
name
Code:
ex_version
In the example above you can see that
Code:
$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
Code:
array_intersect