2017-01-16 10 views
1

私は次の親配列を持っていますが、この親と比較して別の配列から欠けている要素を取得しようとしています。モジュールとアクションを比較する必要があります。多次元配列での検索

Parent 
(
[0] => Array 
    (
     [label] => Masters 
     [module] => masters 
     [action] => unit_index 
    ) 

[1] => Array 
    (
     [label] => Appointments 
     [module] => appointments 
     [action] => appointment_index 
    ) 

[2] => Array 
    (
     [label] => Transactions 
     [module] => transactions 
     [action] => 
    ) 

[3] => Array 
    (
     [label] => Reports 
     [module] => p_reports 
     [action] => ds_index 
    ) 

私は、次の子配列

Array 
(
[masters] => Array 
    (
     [label] => Masters 
     [action] => unit_index 
     [module] => masters 
    ) 

[transactions] => Array 
    (
     [label] => Transactions 
     [action] => 
     [module] => transactions 
) 
[p_reports] => Array 
    (
     [label] => Reports 
     [action] => ds_index 
     [module] => p_reports 
    ) 

に親から欠落している項目を取得したい)

私はin_arrayで検索しても、いくつかを使用してみましたバージョンの再帰的な配列が、私は複数のキーで検索を傾ける。

+0

場合は、最初に対応するキーを返します期待される出力? – slier

+0

アレイ( [ラベル] =>予定 [モジュール] =>予定 [作用] => appointment_index )の両方に存在しないもの – user5349142

答えて

0

check this page

PHP 4> = 4.0.5、PHP 5、PHP 7)

array_searchは - URが何であるかを指定された値の配列を検索し、成功

関連する問題