Skip to content

Instantly share code, notes, and snippets.

@MZAWeb
Created Aug 26, 2012
Embed
What would you like to do?
<?php
$expert_parents = array( array( "parent_entry_id" => "1758" ), array( "parent_entry_id" => "151" ), );
$topic_parents = array( array( "parent_entry_id" => "151" ),
array( "parent_entry_id" => "1815" ),
array( "parent_entry_id" => "2548" ),
array( "parent_entry_id" => "2550" ), );
function find_matches( $val1, $val2 ) {
return ( intval( $val1["parent_entry_id"] ) - intval( $val2["parent_entry_id"] ) );
}
$all_parents_assoc = array_uintersect( $topic_parents, $expert_parents, 'find_matches' );
var_dump( $all_parents_assoc );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment