How to check if mcrypt extension exists in php
问题 I would like to know the simplest and fastest PHP code line to check if mcrypt extension is available/installed. There is a function that encrypts a string and first it requires to check if mcrypt is usable. If not, it will execute an alternative encrypt solution available on the system. Thanks! 回答1: You can use function_exists to check if one of the mcrypt functions exists. if(function_exists('mcrypt_encrypt')) { echo "mcrypt is loaded!"; } else { echo "mcrypt isn't loaded!"; } Edit 30.07