i have a simple question:
i have this var: $v = \"24000,1500,1500,1500,1500,1500,\";
i would like to add those numbers together.
i\'ve
The explode function works best in your situation. What explode does is that it splits the string based on the parameter that you specify it. You can think of it as slicing the string based on the parameter and putting it in an array.
Once done, you have a bunch of numbers in the array. Just do a sum. If you want to ensure that all are numbers, you can use is_numeric() to ensure. (: