Implode data from a multi-dimensional array

前端 未结 7 985
梦毁少年i
梦毁少年i 2020-11-22 12:30

I\'m a novice at PHP and I need a quick solution to the following problem but can\'t seem to come up with one:

I have a multi-dimensional array like so



        
7条回答
  •  孤城傲影
    2020-11-22 12:57

    very simple go for this

    $str;
    foreach ($arrays as $arr) {
    $str .= $arr["tag_name"] . ",";
    }
    $str = trim($str, ',');//removes the final comma 
    

提交回复
热议问题