PHP add single quotes to comma separated list

前端 未结 7 1143
逝去的感伤
逝去的感伤 2021-02-05 05:55

When I implode my array I get a list that looks like this:

qwerty, QTPQ, FRQO

I need to add single quotes so it looks like:

\'         


        
7条回答
  •  暖寄归人
    2021-02-05 06:26

        $ids = array();
        foreach ($file as $newaarr) {
            array_push($ids, $newaarr['Identifiant']);
    
        }
       $ids =array_unique($ids);
        //$idAll=implode(',',$ids);
    
         $idAll = "'" . implode ( "', '", $ids ) . "'";
    

提交回复
热议问题