Casting variable to array for foreach.