In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
I would like to share with you how php capitalizes the array. I hope you will get something after reading this article. Let's discuss it together.
Php will convert the array to uppercase methods: 1, create a PHP sample file; 2, define an associative array; 3, use the foreach statement to traverse the array; 4, use the strtoupper function to capitalize the array elements.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
How to change the key value to uppercase in PHP associative array
We have an array like this:
$fruits = array ('A' = > 'Apple',' B' = > 'Banana',' c'= > 'Cherry',' o' = > 'Orange')
We capitalize all the array element values in it:
Use the foreach statement to iterate through the $fruits array, and use the strtoupper ($value) function in the loop to uppercase the array element $value, so the output is:
After reading this article, I believe you have a certain understanding of "how php capitalizes arrays". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.