Is it possible to use multiple indexes in php?
<p>I would like to do something similar to the following.</p>

<pre><code>$ind=array('a','b','c');
$arr['a']=1;
$arr['b']=4;
$arr['c']=7;
$d= $arr[$ind];
print_r($d);
</code></pre>

<p>It obviously doesnt work and I was wondering if there is still a simple way to do it in 1 or two lines of code.</p>

<p><strong>EDIT</strong></p>

<p>Here is a better example to demonstrate what I mean.</p>

<pre><code>$ind=array('a','c','b','d','e','a','a');
$arr['a']=1;
$arr['b']=4;
$arr['c']=7;
$d=$arr[$ind];
</code></pre>

<p>Now I want to receive that $d is equal to 1,7,4,1,1</p>

<p>array_intersect_key doesnt work. Or at least I cant make it work for me. I was thinking array_walk and a lamda function or something. Anyone?</p>

<p>NOTE: This syntax is available in Matlab (well, almost). So you could for example type:</p>

<pre><code>arr=rand(20,1);
ind=[1 2 10 2 1 1];
newArr=arr(ind); 
</code></pre>

<p>and it would produce vector of length 6 with the values as indexed by the ind vector.</p>
