Works/PHP

php 함수지원여부 확인 소스

Antamis 2016. 4. 25. 10:06

<?

if (function_exists('imagerotate')) {
        echo "imagerotate OK";

 } else {
        echo "imagerotate NO";

}

?>

예제는 수많은 php 함수 중 imagerotate 가 있는지 판별하여 있다면 imagerotate OK 를 출력하고 없다면 imagerotate NO 를 출력한다.
function_exists('imagerotate') 에 imagerotate 외 다른 함수를 입력하면 다른 함수 체크 가능