Encryption is the process of converting a normal message (plaintext) into a meaningless message (Ciphertext). Whereas Decryption is the process of converting meaningless messages (Ciphertext) into its original form (Plaintext). The reason we do so is to hide the original data to be hidden indirect way of viewing and to protect the sensitive data. In simple it is like locking and unlocking the data.
PHP which I personally like very much and recommend everyone for use whenever you see there is a requirement of encryption of any kind of sensitive data in PHP.