openssl_encrypt($your_data, $encryption_algorithm, $encryption_key, $options, $initialization_vector) - This PHP function encrypts a given data with a given encryption method and key, to return a raw or base64 encoded string.
Once you have your ciper data, try using the openssl_decrypt() function to decrypt it back to its original plain text data. To use this, you will need to have the IV, cipher data, the encryption algorithm used, and the encryption key.