php - Check if a class exist in a file -


i want create little function parameters : "class_name" , "file_name".

this function return "true" if class name given exists in file given else "false".

i not know how that.

use class_exists():

class_exists('class_name'); 

it check if class has been defined , return boolean.

and function asking should mention how want , purpose.

update:

token_get_all(file_get_contents('index.php')); 

will return tokens particular file. can check returned array class existance. token_get_all


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -