Many thanks for the critique - I just wondered if it was possible....
As for the shortening of the code itself.. and removing of the $tot - I do agree, however I musta missed it when shortening the code after testing... (echo $tot to verify was easier than echo $arr[$i]*$z; But there ya go....)
As for += and -= something I am not familiar with - any clues ?
As for the verification of numerical values only and the spaces thing, an is_nan and a nice regexp or str_replace would sort that one out.....
See the amended version....
[edit]
And amended again += is good 😃