Red Blaze
03-27-2006, 07:03 PM
This is the little piece of code I'm trying to get working.
<?php
$priceids = $row_call_albums['priceids'];
$arr = array($priceids);
foreach ($arr as $value) {
$value = $value * 2;
echo $value;
}
?>
In this case, $priceids calls 1, 2, 3.
Now, it does call it, but it doesn't loop. It does 1x2, and stops there. But if I replace "$priceids" with "1, 2, 3", it works just fine. It multiplies 1x2, then 2x2, then 3x2.
The results with $priceids in the array is just "2". But the results for "1, 2, 3" in the array is "246".
Is there a way around this issue? Thanks in advance.
<?php
$priceids = $row_call_albums['priceids'];
$arr = array($priceids);
foreach ($arr as $value) {
$value = $value * 2;
echo $value;
}
?>
In this case, $priceids calls 1, 2, 3.
Now, it does call it, but it doesn't loop. It does 1x2, and stops there. But if I replace "$priceids" with "1, 2, 3", it works just fine. It multiplies 1x2, then 2x2, then 3x2.
The results with $priceids in the array is just "2". But the results for "1, 2, 3" in the array is "246".
Is there a way around this issue? Thanks in advance.