Let\'s say I have this:
$array = array(\"john\" => \"doe\", \"foe\" => \"bar\", \"oh\" => \"yeah\"); foreach($array as $i=>$k) { echo $i.\'-\'.$
try this code after foreach condition then echo $result1
$result1=substr($i, 0, -1);