Functions for Classes:
File:class_example.php
<?php class Student{ } $classes=get_declared_classes(); echo "classes:".implode(',',$classes).'<br>'; $class_names=['Teacher','Student','student']; foreach($class_names as $class_name){ if(class_exists($class_name)) { echo "{$class_name} is declared class.<br>"; } else { echo "{$class_name} is not declared class.<br>"; } } ?>
Output
Teacher is not a declared class Student is a declared class student is a declared class