Results 1 to 3 of 3

Thread: multiply with array_walk Please help

  1. #1
    Join Date
    Sep 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face multiply with array_walk Please help

    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

  2. #2
    Join Date
    Sep 2004
    Location
    UK
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    $order = array(14.54, 49.25, 12.45, 14.25);
    function multiply(&$number){
    $number = ($number * 0.675);
    }
    array_walk($order, 'multiply');

  3. #3
    Join Date
    Sep 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much.
    Mar

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •