What is exact difference between the event and function.

I am new in Yii and I want to know why we use event although the function may work in the same way and also provide the example for use of events in real life problem.

How would you want to use function for that purpose?

Be more specific pleaseā€¦

Can you be more specific about your idea? We may not give you an appropriate answers if you just ask vaguely

I do not understand the exact uses of the event in the yii.

Use cases are the same as using event in general: you may create a system which is doing things and triggering events without taking care about logging, sending emails etc. All these additional things could be done by other non-related components responding to events.