<?php echo fix_names("WILLIAM", "henry", "gatES"); function fix_names($n1, $n2, $n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); return $n1 . " " . $n2 . " " . $n3; }
echo "<strong>Fixing array of names to upper case first letter</strong> <br>"; $name1 = "WiLLiAm"; $name2 = "henry"; $name3 = "Gates"; function fix_names($n1, $n2, $n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); //an array that eats strings and passes $n3 = ucfirst(strtolower($n3)); //them through a lower case method then a // first letter upper case method return $n1 . " " . $n2 . " " . $n3; } echo $name1 . " " . $name2 . " " . $name3 . "<br>"; echo fix_names($name1, $name2, $name3) . "<br><br>"; echo "<strong>Fixing array of names to upper case first letter round 2</strong> <br>"; function fix_names2($n1, $n2, $n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); return array($n1, $n2, $n3); } $names = fix_names2($name1, $name2, $name3); echo $name1 . " " . $name2 . " " . $name3 . "<br>"; echo $names[0] . " " . $names[1] . " " . $names[2] . " <br><br>"; echo "<strong>Fixing array of names to upper case first letter round 3</strong> <br>"; function fix_names3() { global $name1;
<?php $a1 = "WILLIAM"; $a2 = "henry"; $a3 = "gatES"; echo $a1 . " " . $a2 . " " . $a3 . "<br />"; fix_names(); echo $a1 . " " . $a2 . " " . $a3; function fix_names() { global $a1; $a1 = ucfirst(strtolower($a1)); global $a2; $a2 = ucfirst(strtolower($a2)); global $a3; $a3 = ucfirst(strtolower($a3)); }
<?php $name = "mAUlIK"; $father = "NITINbhai"; $surname = 'gangani'; echo $name . ' ' . $father . ' ' . $surname; echo '<br>'; fix_names($name, $father, $surname); echo $name . ' ' . $father . ' ' . $surname; function fix_names() { global $name, $father, $surname; $name = ucfirst(strtolower($name)); $father = ucfirst(strtolower($father)); $surname = ucfirst(strtolower($surname)); }
<?php $a1 = "WILLIAM"; $a2 = "henry"; $a3 = "gatES"; echo $a1 . " " . $a2 . " " . $a3 . "<br>"; fix_names($a1, $a2, $a3); echo $a1 . " " . $a2 . " " . $a3; function fix_names(&$n1, &$n2, &$n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); }
<?php function fix_names($n1, $n2, $n3) { return ucfirst(strtolower($n1)) . ' ' . ucfirst(strtolower($n2)) . ' ' . ucfirst(strtolower($n3)); } echo fix_names("mAUlik", 'NITINBhai', 'GANGANi');
<?php $names = fix_names("WILLIAM", "henry", "gatEs"); echo $names[0] . " " . $names[1] . " " . $names[2]; function fix_names($n1, $n2, $n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); return array($n1, $n2, $n3); }
<?php $fixed = fix_names("mAUliK", "NITINBHAI", 'ganganI'); echo $fixed[0] . ' ' . $fixed[1] . ' ' . $fixed[2]; function fix_names($n1, $n2, $n3) { $n1 = ucfirst(strtolower($n1)); $n2 = ucfirst(strtolower($n2)); $n3 = ucfirst(strtolower($n3)); return array($n1, $n2, $n3); }