In a large skillet, heat a little olive oil over medium heat. Add the finely chopped onion and garlic, and sauté until soft and translucent.
Add the finely chopped spinach to the skillet and cook until wilted. Remove from heat and let it cool slightly.
In a large bowl, combine the crumbled feta cheese, cooked spinach mixture, fresh parsley, fresh dill (if using), beaten eggs, salt, and pepper. Mix well.
Preheat your oven to 350°F (175°C). Grease a 9x13 inch baking dish with some olive oil or melted butter.
Carefully unroll the phyllo dough. Cut the whole stack in half to fit the dish. Cover the dough with a damp cloth to keep it from drying out as you work.
Place one sheet of phyllo dough in the bottom of the baking dish. Brush lightly with olive oil or melted butter. Repeat this process, layering and brushing each sheet, until you have layered 8 sheets of phyllo.
Spread a thin layer of the spinach and feta mixture (about 1/3 of the mixture) over the phyllo dough.
Continue layering with phyllo sheets and spinach mixture until all the filling is used, ending with a top layer of 8 sheets of phyllo, each brushed with olive oil or melted butter.
Using a sharp knife, cut the byrek into squares or diamond shapes.
Bake in the preheated oven for about 45-50 minutes, or until the phyllo is golden brown and crisp.
Let the byrek cool for a few minutes before serving. Serve warm or at room temperature.
Enjoy your meal!