Create arrays with foreach