Hello. There is something like this array:
$abc = array( 0 => array('user_id' => '2'), 10 => array('user_id' => '2', 'useru_id' => '4'), 11 => array('user_id' => '2', 'useru_id' => '3'), 14 => array('user_id' => '4', 'useru_id' => '2'), 16 => array('user_id' => '4', 'useru_id' => '3'), );
You need to convert it with the condition that user_id = 2 and useru_id = 4 or user_id = 4 and useru_id = 2 that would turn out like this:
Array ( [10] => {Любой текст} [14] => {Любой текст} )
The code should be executed as quickly as possible, because The initial array can be VERY BIG.