Ver original$total = ""; foreach ($posts as $post){ $total .= '"'.$post->name_student.'", ';};echo substr($total, 0, -2);