Have you never watched spy films.
You need an encryption key or primer I think in US.
PHP has encryption functions md5() and sha1() but you cannot de-crypt otherwise they would be useless.
So you need a user defined algorithm which is your encrption key.
This can be anything your imagination allows.
Have fun
You could always use the base64_encode and base64_decode functions. But they really are no more secure than plain text.
Totally useless from a security point of view. They exist mostly to encode binary data before sending them through mail bodies and such.
If you need two way encryption for storing sensitive data or something of the sorts, you could always use the OpenSSL support in php. http://php.net/openssl
This site has a lot of different examples of the usage:
Comment