Help with array...

Discussion in 'PHP' started by pixelpie, Nov 3, 2007.

  1. #1
    Hi,

    I need to write a function asum ($a) which takes an array with numbers and adds them together and prints only the total of the three arrays. For example:

    print asum(array(5, 2, 20));

    The browser should only print '27'.

    Thanks.
     
    pixelpie, Nov 3, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Nov 3, 2007 IP
  3. pixelpie

    pixelpie Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your help Nico.
     
    pixelpie, Nov 3, 2007 IP