爆炸功能对我不起作用?

I want to change the string into array after using foreach() so how is it done?

$g = "";
$changer = explode(",", $g);
foreach ($y as $key => $c) {
    foreach ($c['movie'] as $rr) {
        $g .= $rr->movieName . ",";
    }
}

Based on your answer, theres a much easier way to do it than what you're doing:

foreach ($y as $key => $c) {
    foreach ($c['movie'] as $rr) {
        $changer[] = $rr->movieName;
    }
}

I found the answer myself the only problem is the position of my explode function:

<!-- my code -->
$g ="";         
foreach ($y as $key => $c) {
    foreach ($c['movie'] as $rr) {
        $g .= $rr->movieName . ",";
    }
}
$changer = explode(",", $g);