How to convert all array values to lowercase in PHP

How to change array string elements to lower case in and show on screen using strtolower.

In this tutorial we are converting all array indexed alphabetic elements to lower case with the use of strtolower parameter pass into array_map() method. So here is the complete step by step tutorial for How to convert all array values to lowercase in PHP.

android-project-download-code-button

How to convert all array values to lowercase in PHP.

Code for convert-array-values-lowercase.php file.

 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Convert all array values to uppercase</title>
</head>

<body>

<?php

$Name = array("ram","shyam","anil","pankaj");

$name_convert = array_map("strtolower", $Name);

foreach( $name_convert as $NewArray ) {
 
 echo $NewArray . '</br>' ;
 
 }

?>

</body>
</html>

Screenshot:

convert all array values to lowercase in PHP

Click here to download convert all array values to lowercase in PHP project file with source code.

Leave a Reply

Your email address will not be published. Required fields are marked *