Skip to content

Instantly share code, notes, and snippets.

@nixonmedia
Created April 15, 2018 00:45
Show Gist options
  • Save nixonmedia/064fa8b8aa0e46240e385d9d27aac86c to your computer and use it in GitHub Desktop.
Save nixonmedia/064fa8b8aa0e46240e385d9d27aac86c to your computer and use it in GitHub Desktop.
<?php
$output = array();
if(isset($med_sciences) && $med_sciences[0]=="Y"){
array_push($output , 'Medical Sciences');
}
if(isset($food_ag) && $food_ag[0]=="Y"){
array_push($output , 'Food & Agriculture');
}
if(isset($engineering) && $engineering[0]=="Y"){
array_push($output , 'Engineering & Materials');
}
if(isset($energy) && $energy[0]=="Y"){
array_push($output , 'Energy & Environment');
}
if(isset($it) && $it[0]=="Y"){
array_push($output , 'IT & Ed Tech');
}
echo '<span class="cat">';
ob_start();
foreach($output as $result)
{
echo $result.', ';
}
$output = ob_get_clean();
echo rtrim($output, ', ');
echo '</span>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment