How to merge the array values in foreach?
$combined = ”; $k=0; foreach($get_info_contact as $contacts){ foreach($contacts as $contact) { //$combined .= ‘and’; //if(in_array($key if($k==0){ $combined .= ucfirst($contact); }else{ $combined .= ‘ and ‘.ucfirst($contact); } } $k++; } output: alcor and president