I have searched everywhere but can\'t find a solution that works for me.
I have the following:
$bedroom_array = array($studio, $one_bed, $two_bed, $t
$bedroom_list = implode(", ", array_filter($bedroom_array)); $vars = $bedroom_list; $last = strrchr($vars,","); $last_ = str_replace(",","&",$last); echo str_replace("$last","$last_",$vars);