Last active
April 19, 2019 16:03
-
-
Save msisaifu/fa982d3408355cfd48182d7ccddeefb2 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 reverseCase($string) { | |
$length = strlen($string); | |
for($i = 0; $i < $length; $i++) { | |
if(ctype_upper ($string[$i])) { | |
echo strtolower($string[$i]); | |
} else { | |
echo strtoupper($string[$i]); | |
} | |
} | |
} | |
reverseCase('hello Bangladesh'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment