判斷類是否存在函數class_exists用法分析

原文地址:判斷類是否存在函數class_exists用法分析php


若是咱們要判斷一個類是否是能夠用,能夠先使用class_exists函數來判斷一下,下面來看幾個例子。函數

bool class_exists ( string $class_name [, bool $autoload = true ] )this

此功能是否給定的類被定義檢查。this function checks whether or not the given class has been defined.返回true,若是class_name是一個定義的類,不然返回false。spa

實例以下:orm

相關文章
相關標籤/搜索