How do I encrypt a string in PHP?

Viewed 72381

I want to make an encryption function that should have some secret key. Something like the following:

function encrypt($string) {
    $key = "mastermind";
    $enc = encryptfunc($string, $key);

    return $enc;
}

The same thing should apply for decryption.

5 Answers
Related