Lower Case an Array
Here is an example of how to force all values in array tolower case. This could, of course, be used in the same way to make the array UPPERCASE or do anything else you wish to the array values. Note the that the string is passed to the array by reference. This is so the actual array values are manipulated.
<?php
/*** an array of mixed case words ***/
$array = array('MAC', 'Apple', 'osX');
/**
*
* @Lower case an array
*
* @param ref string $string
*
* @return string
*
*/
function lower(&$string){
$string = strtolower($string);
}
/*** apply the lower function to the array ***/
array_walk($array,'lower');
foreach($array as $value){
echo $value;
}
?>
Secure file download in PHP, Security question PHP, PHP MYSQL Interview Question -Books download - PHP solutions guidelines queries update, phpmysqlquestion
Saturday, June 6, 2009
Subscribe to:
Posts (Atom)
security header validate
HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)
-
QUESTION: 1 What is the output of the following code? echo '1' . (print '2') + 3; A. 123 B. 213 C. 142 D. 214 E. ...
-
Windows tool for creating a self-signed certificate. https://sourceforge.net/projects/portecle/ kindly install portecle tool from abov...
-
Which pillar of the AWS Well-Architected Framework recommends maintaining infrastructure as code? Operational Excellence Which of the foll...