我有一些值用逗号分隔在4个不同的列中


I have some values in comma separated in 4 different columns

我有这样的值:-

--------------------------------------------------------------------------
Courses      |       Eligibility       |   Duration      |      Fee

BCA,BBA,MBA      10+2,10+2,Graduation      3Y,3Y,2Y         1Lak,1Lak,2Lak 

现在我想要:-

--------------------------------------------------------------------------
Courses      |       Eligibility       |   Duration      |      Fee
BCA                     10+2                  3Y                1Lak
BBA                     10+2                  3Y                1Lak
MBA                   Graduation              2Y                2Lak

Note:-  
  <?php $course='BCA,BBA,MBA'; 
        $eligibility='BCA,BBA,MBA';
        $duration='10+2,10+2,Graduation';         
        $fee='1Lak,1Lak,2Lak'; 
   ?>

我不知道如何解决这个问题,请帮帮我。提前谢谢。

查看explode():

$course = "BCA,BBA,MBA";
$course = explode(",",$course);
//$course is now an array of "BCA", "BBA", "MBA"

我只是简单地将explodeforearch函数一起使用。

$tag1=$data['courses_fee'];
$tags = explode(',', $tag1);
foreach($tags as $vals)
{                                                      
echo $vals."'n"; 
}?>