Heat butter on a frying pan and fry shallot and garlic until fragrant. Then bottom part of spring onions and star anise. Continue to fry for about 2 minutes. Add rice and stir to mix. Make a hole in the middle and add egg into it. Again, stir to mix. Finally add the upper part of spring onions and some salt to taste. Continue to stir until all ingredients are thoroughly mixed.