Home >Backend Development >PHP Tutorial >The file name where the PHP detection function is located
A very simple function, using the reflection mechanism in PHP, specifically using the ReflectionFunction class, to obtain the specific location in the PHP script where the specified function is located. Create a reference script.
Php code
// Filename: functions.php <?php function now() { return time(); } ?>
calls the function.
Php code
// Filename: call_now.php <?php require 'functions.php'; Reflection::export(new ReflectionFunction('now')); // Function [ function now ] { @@ H:\www\functions.php 2 - 4 } ?>