Last active
June 25, 2019 07:40
-
-
Save malikalichsan/7c362fd4aea41e8555ee391020eb96ad to your computer and use it in GitHub Desktop.
Summarize String in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = "1,2,3,4,5,6,7"; // String | |
$sum = array_sum(explode(',', $data)); | |
print_r($sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment