Convenience method to create array of percentages from another array
<p>I would like to perform the following server-side in PHP...</p>

<p>If I have one array like this: <code>$array1 = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)</code>, can I create another array which contains the percent of each value (each value divided by the total)? Is there a way to do this without brute forcing with a for loop? I essentially want to create array2</p>

<p><code>sum_array($array1)</code> produces 55 (1+2+3+4+5+6+7+8+9+10 = 55)</p>

<p><code>$array2 = array(1.8%, 3.6%, 5.4%, 7.2%, 9%, 10.9%, 12.7%, 15.5%, 16.3%, 18.2%)</code> </p>

<p>Thanks in advance</p>
