remove foreach

replace foreach by implode.