What are some common methods for encrypting words in PHP?

One common method for encrypting words in PHP is to use the `openssl_encrypt` function with a specified encryption algorithm and key. Another method is to use the `mcrypt_encrypt` function, although it is deprecated in newer PHP versions. Additionally, you can use third-party libraries like `phpseclib` for more advanced encryption techniques.

// Using openssl_encrypt function
$plaintext = "Hello World";
$key = "secretkey";
$method = "AES-256-CBC";
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method));
$ciphertext = openssl_encrypt($plaintext, $method, $key, 0, $iv);

echo $ciphertext;