note 93757 deleted from function.preg-replace by danbrown
| From: | danbrown@php.net | Date: | Tue, 29 Sep 2009 22:20:34 +0000 |
| Subject: | note 93757 deleted from function.preg-replace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161156@lists.php.net to get a copy of this message | ||
Note Submitter: m dot ahmed at zingyso dot com
----
Caps Lock Function,
<?php
function CapsLock($string){
$step1 = preg_replace("#[a]#", "A", $string);
$step2 = preg_replace("#[b]#", "B", $step1);
$step3 = preg_replace("#[c]#", "C", $step2);
$step4 = preg_replace("#[d]#", "D", $step3);
$step5 = preg_replace("#[e]#", "E", $step4);
$step6 = preg_replace("#[f]#", "F", $step5);
$step7 = preg_replace("#[g]#", "G", $step6);
$step8 = preg_replace("#[h]#", "H", $step7);
$step9 = preg_replace("#[i]#", "I", $step8);
$step10 = preg_replace("#[j]#", "J", $step9);
$step11 = preg_replace("#[k]#", "K", $step10);
$step12 = preg_replace("#[l]#", "L", $step11);
$step13 = preg_replace("#[m]#", "M", $step12);
$step14 = preg_replace("#[n]#", "N", $step13);
$step15 = preg_replace("#[o]#", "O", $step14);
$step16 = preg_replace("#[p]#", "P", $step15);
$step17 = preg_replace("#[q]#", "Q", $step16);
$step18 = preg_replace("#[r]#", "R", $step17);
$step19 = preg_replace("#[s]#", "S", $step18);
$step20 = preg_replace("#[t]#", "T", $step19);
$step21 = preg_replace("#[u]#", "U", $step20);
$step22 = preg_replace("#[v]#", "V", $step21);
$step23 = preg_replace("#[w]#", "W", $step22);
$step24 = preg_replace("#[x]#", "X", $step23);
$step25 = preg_replace("#[y]#", "Y", $step24);
$step26 = preg_replace("#[z]#", "Z", $step25);
$Caps = $step26;
echo $Caps;
}
CapsLock("Anything");
?>