returning the min array value index
<p>I Am trying to compare 3 different array prices in order to find the lowest so that I can decide which array values should be input into a database, the code looks something like this at the moment...</p>

<pre><code>$array_a = array(
   "id"    =&gt; 398,
   "price" =&gt; 100 
);

$array_b = array(
   "id"    =&gt; 387,
   "price" =&gt; 60
);

$array_c = array(
   "id"    =&gt; 127,
   "price" =&gt; 50
);

if($array_a &amp;&amp; $array_b &amp;&amp; $array_c){
   $newArr = array($array_a['price'], $array_b['price'], $array_c['price']);
   array_keys($newArr, min($newArr));
   print_r($newArr)."\n"; 
}
</code></pre>

<p>The above code does not return the correct index of the array with the lowest price which in this case would be 2 (array_c), what would be the correct way to find out the key of the lowest value.</p>

<p>Also what would be the best way to make sure that only numbers are compared with the min() function as opposed to strings?</p>
