Many times we store our data in array and need to perform some additional function to the array like strtolower, strtoupper, and etc. Before i get to know this handy function, I’ve been searching for the shortest code to perform strtolower to an array in php. Thank god, finally i found array_map function and it solved my many years problem.
To strtolower an array in php, use the code below:-
Advertisements
$myarray = array('XyZ', 'AbC', 'EFG');
$myarray = array_map('strtolower', $myarray);
You may also check out the documentation on array_map
Related posts:
How to reduce admin generator query in Symfony 1.4
Symfony: How to escape hash # character in yaml
WordPress: How to upload image using script?
Symfony 1.4 - Customize Admin Generator listing to show data from foreign tables
Virtue Theme: How to enable slider in shop page?
How to install apache, php, mysql with macport in Mac OS X
Symfony: PHP Fatal error: Call to a member function setData()
Symfony 1.4: How to sort foreign key record?
Share this with your friends:-