SSL certificates tend to be handled at the server level versus the PHP level.
I'd recommend checking out some SSL certificate providers. They have a LOT of documentation depending on what flavor web server (such as Apache, IIS, etc) you're running. To get an SSL cert, its not difficult, but there's a good number of steps you need to follow. The SSL cert provider you go through should have those steps outlined in their documentation.
If you're the server admin, then you can do this all yourself. If you're hosting from someone, then you'll need to contact the hoster and let them know you need an SSL cert. They may have to do a number of the steps for installing the cert...