How to display element characters in php arrays

Source: Internet
Author: User
How do I display the characters of an element in a php array? $ Data ['A'] = 1; $ data ['B'] = 2; $ data ['c'] = 3; I want to display: abc is not to display the element value, but to display the characters of the element itself. What are you talking about? $ Data = array ('a' = & gt; 1, 'B' = & gt about the php array, how do I display the characters of the element itself?
$ Data ['A'] = 1;
$ Data ['B'] = 2;
$ Data ['c'] = 3;

I want to display:
A
B
C

Not to display the element value, but to display the characters of the element itself

------ Solution --------------------
What are you talking about?

$ Data = array ('a' => 1, 'B' => 2, 'C' => 3 );

Foreach ($ data as $ key => $ value ){
Echo $ key;
}
Key? What do you mean.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.