How can I multiply each item in an array easily with PHP?
Posted
by Henry
on Stack Overflow
See other posts from Stack Overflow
or by Henry
Published on 2010-04-17T21:30:13Z
Indexed on
2010/04/17
21:33 UTC
Read the original article
Hit count: 244
I have an array called $times. It is a list of small numbers (15,14,11,9,3,2). These will be user submitted and are supposed to be minutes. As PHP time works on seconds, I would like to multiply each element of my array by 60.
I've been playing around with array_walk and array_map but I can't get those working :S
Thanks.
© Stack Overflow or respective owner