Created
November 30, 2019 14:15
-
-
Save hiyorineko/07935db960b9dc42feea7689fff36ffa to your computer and use it in GitHub Desktop.
This file contains 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
function accum($s) { | |
$result = array(); | |
for ($i = 0; $i < strlen($s); $i++) { | |
$str = ""; | |
for ($j = 0; $j <= $i; $j++) { | |
$str = $str . $s[$i]; | |
} | |
$result[] = ucfirst(strtolower($str)); | |
} | |
return implode("-", $result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment