PHP的弱智有关问题

WBOY
Release: 2016-06-13 10:20:21
Original
846 people have browsed it

PHP的弱智问题
我有这么一个数组Array ( [A] => 22 [B] => 12 [C] => 6 ) 

我怎么样才能得到相应属性的值,然后类似于输出A:22,B:12,C:16的格式呢??

有一个问题是这个A\B\C不固定,可能是E\F\G(动态的)






------解决方案--------------------
我想你要的是这个
$ar = array ( 'A' => 22, 'B' => 12, 'C' => 6 );
echo json_encode($ar);


{"A":22,"B":12,"C":6}

------解决方案--------------------

我看楼主也是要这样。。json格式

探讨

我想你要的是这个
$ar = array ( 'A' => 22, 'B' => 12, 'C' => 6 );
echo json_encode($ar);


{"A":22,"B":12,"C":6}
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!