Yeah, it sounds like you mean a CAPTCHA.
Are you asking why they're used, or how to implement one?
They're used to stop people from writing bots that automatically register and do unwelcome things, such as spamming your message board. It's easy for a human to read the text from such an image, but much more difficult to write a script to do it.
If you're wondering how to implement one, just Google on "php captcha". There are plenty of libraries out there.