i have a json data in controller i am passing it to twig file . i want to loop json data in twig file to create equal attributes like shown below : **       this is my controller where i am creating json data and passing it to twigfile**
   
      /**
      *this route is  for inserting data into datatable of modal of bootstrap
      *@Route("/pagerduty/edit_team_datatable")



      *@return Response
      */
      public function edit_teble(Request $request){
         $edit = new team_details();
         $row_id = $request->query->get('row_id');
         $query= ("SELECT tr.id, GROUP_CONCAT(u.usrName SEPARATOR ',') AS team_members  FROM team_details td
                            INNER JOIN team_registration tr ON tr.id=td.team_name
        					INNER JOIN user u ON u.usrid=td.team_members_names
        					where td.team_name=$row_id
                            GROUP BY td.team_name");
         $em = $this->getDoctrine()->getManager();
         $statement = $em->getConnection()->prepare($query);
         $statement->execute();
         $result = $statement->fetch();
         // print_r($result);die;
         //return $this->render("team_display.html.twig",array('edit_table'=>$result));
         return new JsonResponse($result);
        }


<!-- begin snippet: js hide: false console: true babel: false -->

** i am receiving json response in this manner where id is only "1" and  team_members is "8" .so,now i want to create 8 id for 8 team members plz help me in achieving  this 
**
   
    this is json data :
    {"id":"21","team_members":"teja,preetham,kick,preetham,teja,meuser,kick,preetham"}
      
      
      what i need is this format using looping plz help me :
       {"id":"21,21,21,21,21,21,21,21","team_members":"teja,preetham,kick,preetham,teja,meuser,kick,preetham"}

<!-- end snippet -->

