BrainPill Posted May 29, 2019 Share Posted May 29, 2019 Hi there I made a function for getting the location of an error. The script where the error is, is done with $_SERVER['SCRIPT_FILENAME'] but when using __LINE__ I get the location of the script where the function code is placed, not where the function is executed. How can I solve this? example: <?php function find_file_linenum() { echo '<br><br>'; echo $_SERVER['SCRIPT_FILENAME']; echo '<br><br>login/condition error at line : .... '; echo __LINE__; echo '<br><br>'; } ?> Link to comment Share on other sites More sharing options...
justsomeguy Posted May 29, 2019 Share Posted May 29, 2019 https://www.php.net/manual/en/function.debug-backtrace.php 1 Link to comment Share on other sites More sharing options...
BrainPill Posted May 31, 2019 Author Share Posted May 31, 2019 On 5/29/2019 at 7:29 PM, justsomeguy said: https://www.php.net/manual/en/function.debug-backtrace.php this really helped me out thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now