PHP Array Exercises : Lower-case and upper-case, all elements in an array
Write a PHP script to lower-case and upper-case, all elements in an array.
Sample Solution:
PHP Code:
Output:
Array ( [0] => Red [1] => Green [2] => Black [3] => White ) Array ( [0] => red [1] => green [2] => black [3] => white ) Array ( [0] => RED [1] => GREEN [2] => BLACK [3] => WHITE )
Flowchart:

PHP Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a PHP script to trim all the elements in an array using array_walk function.
Next: Write a PHP script to count the total number of times a specific value appears in an array.
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