How to do programme where user can input only HTML tag?

I am working with PHP , In my project i have a user input option . I want to know that how i have to program - where users can input there texts/image with HTML tags only . If they input any javascript or php code or others it will be error but they will be able to use only HTML tag . So please tell me that code . So that i can add those code in my PHP script.

Thanks in advance.