I am trying to order an array produced by a foreach loop, here is my code:
$lowestvar = array();
foreach ($variations as $variation){
$lowestvar[] = $variation['price_html'];
}
I am then using array_multisort like this:
array_multisort($lowestvar, SORT_ASC);
print_r($lowestvar);
This works for the first looped item with a output of:
Array ( [0] => £10.00 [1] => £15.00 )
But the second array in the loop looks like this:
Array ( [0] => £10.00 [1] => £5.00 )
Any ideas on where i am going wrong?
echo '<pre>'.print_r($variations, 1).'</pre>';.