Created
October 20, 2015 08:23
-
-
Save d30jeff/153d04bb91804dbb4171 to your computer and use it in GitHub Desktop.
Ultimate Retard Solution
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 | |
| $retardadize = function($string, $firstRetard) { | |
| $each = str_split(strtolower($string)); | |
| $ultimateRetardSolution = ""; | |
| $retardPotion = ($firstRetard) ? true : false; | |
| foreach ($each as $x ) { | |
| if ($retardPotion) { | |
| $ultimateRetardSolution .= strtoupper($x); | |
| $retardPotion = (ctype_space($x)) ?: false; | |
| } else { | |
| $ultimateRetardSolution .= strtolower($x); | |
| $retardPotion = (ctype_space($x)) ?: true; | |
| } | |
| } | |
| return $ultimateRetardSolution; | |
| }; | |
| echo $retardadize("Hello World", false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment