关于php数组,怎么显示元素本身字符

WBOY
Release: 2016-06-12 16:19:54
Original
979 people have browsed it

关于php数组,如何显示元素本身字符?
$data['a']=1;
$data['b']=2;
$data['c']=3;

我想显示:
a
b
c

不是要显示元素的值,而是要显示元素本身的字符

------解决方案--------------------
你说的是key?

$data=array('a'=>1,'b'=>2,'c'=>3);

foreach ($data as $key=>$value){
echo $key;
}
是不是key?还是啥意思.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template