Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function inverte_caracteree_muda_segunda_maiuscula($str){
- $ct_str = strlen($str);
- $n_str = null;
- $n_str_r = null;
- for($i = $ct_str; $i >= 0; $i--){
- $n_str .= $str[$i];
- }
- for($i = 0; $i <= $ct_str; $i++){
- $quebra_indice = $i + 1;
- $n_str_r .= ($quebra_indice % 2 == 0) ? strtoupper($n_str[$i]) : strtolower($n_str[$i]);
- }
- return $n_str_r;
- }
- echo inverte_caracteree_muda_segunda_maiuscula("Jefferson Julio :D");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement