Filter 2D array by comparing column values against a differently-keyed column in another array
<p>I have 2 arrays that I'm working with.
The first array comes from the data of a CSV file and the other is a response from an API.</p>
<p>Is it possible to filter array 2 by using matching values from array 1?</p>
<p>Array 1 Example</p>
<pre><code>[
    [&quot;B00CEEZ57S&quot;],
    [&quot;B002QJZADK&quot;],
    [&quot;B001EHL2UK&quot;],
    [&quot;B003FSTNB6&quot;],
]
</code></pre>
<p>Array 2 Example</p>
<pre><code>[
    [
        &quot;name&quot; =&gt; &quot;Jonathan Franzen: Purity (Hardcover); 2015 Edition&quot;,
        &quot;ASIN&quot; =&gt; &quot;B002QJZADK&quot;
    ],
    [
        &quot;name&quot; =&gt; &quot;Cardinal Gates Outdoor Child Safety Gate, Brown&quot;,
        &quot;ASIN&quot; =&gt; &quot;B00CE8C7SO&quot;
    ],
    [
        &quot;name&quot; =&gt; &quot;Sauder Edge Water 71.88\&quot; Bookcase Estate Black Finish&quot;,
        &quot;ASIN&quot; =&gt; &quot;B001EHL2UK&quot;
    ],
    [
        &quot;name&quot; =&gt; &quot;The Pioneer Woman 82695.03R Cowboy Rustic 8\&quot; Rosewood Handle Can Opener, Scis...&quot;,
        &quot;ASIN&quot; =&gt; &quot;B015LU7GPU&quot;
    ]
]
</code></pre>
<p>These rows should be kept:</p>
<pre><code>[
    'name' =&gt; 'Jonathan Franzen: Purity (Hardcover); 2015 Edition',
    'ASIN' =&gt; 'B002QJZADK',
],
[
    'name' =&gt; 'Sauder Edge Water 71.88&quot; Bookcase Estate Black Finish',
    'ASIN' =&gt; 'B001EHL2UK'
]
</code></pre>