Try something like this:
$tmp = array($c1,$c2,$c3,$c4);
$filtered = array_filter($tmp);
$for = implode(",", $filtered).".";
This will strip out any $c_
variables that aren't populated, and separate them with commas.
EDIT: I have reivewed your code, and would like to suggest this optimised version:
$keys = array("Crossfit","Muaythai","MMA","Gymnastics");
$result = array();
foreach($keys as $i=>$name) {
if( $_SESSION[strtolower($name)] == "Y") {
$duration = $_SESSION['tr_duration'.($i+1)];
switch($duration) {
case 1: $dur = "1 Month"; break;
case 12: $dur = "1 Year"; break;
default: $dur = $duration." Months";
}
$result[] = $name." - ".$dur;
}
}
if( !$result) $for = "Nothing selected!";
else $for = implode(", ",$result).".";
If you need help understand what's going on here, feel free to ask!