How to convert array values to lowercase in PHP ? Last Updated : 24 Jun, 2021 Comments Improve Suggest changes Like Article Like Report Given an array containing uppercase string elements and the task is to convert the array elements (uppercase) into lowercase. There are two ways to convert array values to lowercase in PHP. Using foreach loopUsing array_map() function Using foreach loop: In this approach, an iterator iterates through the value of an array individually and convert each array elements into lowercase and stores the converted values to the original array.Program: PHP <?php // Declare an array $arr = array('GFG', 'GEEK', 'GEEKS', 'GEEKSFORGEEKS'); $j = 0; // Iterate loop to convert array // elements into lowercase and // overwriting the original array foreach( $arr as $element ) { $arr[$j] = strtolower($element); $j++; } // Display the content of array foreach( $arr as $element ) echo $element . "\n"; ?> Output: gfg geek geeks geeksforgeeks Using array_map() function: In this approach, the array_map() function is used to accept two parameters callback and an array. Syntax: array array_map( callable callback, array array ) Here callback is a function to be called for operation on an array. This function can be an inbuilt function or an user-defined function whereas array is list of values on which operation to be performed.Program 2: PHP <?php // Declare an array $arr = array('GFG', 'GEEK', 'GEEKS', 'GEEKSFORGEEKS'); $arr = array_map( 'strtolower', $arr ); // Display the content of array foreach( $arr as $element ) echo $element . "\n"; ?> Output: gfg geek geeks geeksforgeeks Comment More infoAdvertise with us Next Article How to convert array values to lowercase in PHP ? R rupanisweety Follow Improve Article Tags : Web Technologies PHP PHP Programs Similar Reads How to Convert Array to String in PHP? In PHP, Arrays are used to store multiple values in a single variable. However, sometimes we need to convert these arrays into strings:To display array data in a readable format.To join array items into a single sentence or list.To use the array data where only strings are accepted.To prepare data f 2 min read How to convert PHP array to JavaScript or JSON ? PHP provides a json_encode() function that converts PHP arrays into JavaScript. Technically, it is in JSON format. JSON stands for JavaScript Object Notation. Statement: If you have a PHP array and you need to convert it into the JavaScript array so there is a function provided by PHP that will easi 2 min read How to convert an array into object using stdClass() in PHP? To convert an array into the object, stdClass() is used. The stdClass() is an empty class, which is used to cast other types to object. If an object is converted to object, its not modified. But, if object type is converted/type-casted an instance of stdClass is created, if it is not NULL. If it is 3 min read How to Convert Integer array to String array using PHP? Given is an integer Array, the task is to convert the Integer array to a String array and print the output.Example:Input: $integerArray = [10, 20, 30, 40, 50];Output: ["10", "20", "30", "40", "50"]These are the following approaches:Table of ContentUsing the array_map() and strval() functionUsing a l 4 min read How to Convert Query String to an Array in PHP? In this article, we will see how to convert a query string to an array in PHP. The Query String is the part of the URL that starts after the question mark(?).Examples:Input: str = "company=GeeksforGeeks&address=Noida&mobile=9876543210"Output: Array ( [company] => GeeksforGeeks [ad 4 min read How to Get All Values from an Associative Array in PHP? Given an Associative Array, the task is to get all values from the associative array in PHP. To get all the values from an associative array, you can use various approaches such as foreach loop, array_values() function, and array_map() function. In this article, we will explore each approach with de 3 min read PHP Program to Convert String to ASCII Value Given a String the task is to convert the given string into ASCII code using PHP. ASCII is the American Standard Code for Information Interchange, which is a widely used standard for encoding characters in computers and digital communication systems. There are two methods to convert a given String i 2 min read How to Convert String to Camelcase in PHP? Given a String containing spaces, the task is to Convert String to Camelcase in PHP. Converting a string to CamelCase is a common operation in PHP, especially when working with variable names or class names. CamelCase is a naming convention where the first letter of each word in a compound word is c 3 min read How to determine if an array contains a specific value in PHP? Determining if an array contains a specific value in PHP involves verifying whether a particular element exists within an array. This task is essential for various programming scenarios, such as searching for user input, validating data, or filtering results based on specific criteria. PHP offers se 2 min read How to Iterate Over an Array in PHP? Arrays are fundamental data structures in PHP, and the ability to iterate through them is crucial for manipulating and processing data. In this article, we will explore various approaches to iterate through arrays in PHP.Table of ContentUsing for LoopUsing foreach LoopUsing while Loop with each() Fu 3 min read Like