Q:

Write a PHP script to

0

Write a PHP script to : -

a) transform a string all uppercase letters.
b) transform a string all lowercase letters.
c) make a string's first character uppercase.
d) make a string's first character of all the words uppercase.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
//all uppercase letters
print(strtoupper("the quick brown fox jumps over the lazy dog."))."\n";
//all lowercase letters
print(strtolower("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"))."\n";
// make a string's first character uppercase
print(ucfirst("the quick brown fox jumps over the lazy dog."))."\n";
// make a string's first character of all the words uppercase
print(ucwords("the quick brown fox jumps over the lazy dog."))."\n";
?>

Sample Output:

THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.                
the quick brown fox jumps over the lazy dog                 
The quick brown fox jumps over the lazy dog.                
The Quick Brown Fox Jumps Over The Lazy Dog.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now