PHP Array Exercises : Change the array values to upper or lower case
Write a PHP function to change the following array's all values to upper or lower case.
Sample arrays :
$Color = array('A' => 'Blue', 'B' => 'Green', 'c' => 'Red');
Sample Solution:
PHP Code:
Output:
Actual array Array ( [A] => Blue [B] => Green [c] => Red ) Values are in lower case.Array ( [A] => blue [B] => green [c] => red ) Values are in upper case.Array ( [A] => BLUE [B] => GREEN [c] => RED )
Flowchart:

PHP Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a PHP program to merge (by index) the specified two arrays.
Next: Write a PHP script which displays all the numbers between 200 and 250 that are divisible by 4.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics