PHP array two-dimensional array conversion
过去多啦不再A梦
过去多啦不再A梦 2017-07-04 13:46:19
0
3
795
$oldArr = [ ['a', 1], ['', 2], ['', 3], ['b', 4], ['', 5], ['c',6], ['',7] ]; 转换为 $newArr = [ 'a'=>'1,2,3', 'b'=>'4,5', 'c'=>'6,7' ]
过去多啦不再A梦
过去多啦不再A梦

reply all (3)
某草草
    学习ing

    Shouldn’t we think about why the arrays are spliced like this?

      大家讲道理

      I feel that when fetching it from the database, it can be processed with mysql built-in functions
      such as concat() or concat_group()

        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!