New post/comment box with options

I have been in the process of creating a blog from scratch as a way to teach myself PHP and MySQL. I am at the point where I want to spruce up my add a post box, as well as a comments box. My question is: How do I create a comment box that gives the user HTML tag options such as hyperlink, bold, italics, etc. at the top of the box? Is there a way to do this in PHP? Or would it be another programming language?

Any help is much appreciated!

There are may others like it but an example of what you are looking for would be something like:

Remember to be very careful when filtering the data PHP side to make sure you don’t have any nasty HTML/JS in the comment.