PDA

View Full Version : multiply with array_walk Please help



Mar
11-20-2004, 04:06 PM
Hi, I am new at php and I really need help.

If I had an array as such:

$order = array (14.54, 49.25, 12.45, 14.25);
How would I use an array_walk function to multiply each value in $order by .0675 ?????????

Please help,
Thank you in advance :confused:

Odin
11-20-2004, 06:47 PM
$order = array(14.54, 49.25, 12.45, 14.25);
function multiply(&$number){
$number = ($number * 0.675);
}
array_walk($order, 'multiply');

Mar
11-20-2004, 06:48 PM
Thank you very much.
Mar