Skip to content

Tag: php

How to explode a string and calculate a sum?

I want $total to be output as just a sum of a number but everytime i sum up $total it outputs multiple numbers expected output: Answer There were a few syntax errors in your codes. Other than that, your calculation looks fine, and great job with explode();. Code: Output: You might check out to see if the math…