[PHP-WIN] Re: How to get script name and line number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"William Cheung" <william@databyte.com> wrote in message
002701c36db3$5fe802c0$3d6ea8c0@databyte.com">news:002701c36db3$5fe802c0$3d6ea8c0@databyte.com...
>>I need to error log the script name and the line number that an error
occurs. Are there built-in variables I could make use of?

There are 2 ways to get file name:

1) Using the 'magic constatns': $thefile = __FILE__;

2) Using $_SERVER superarray:  $thefile = $_SERVER['SCRIPT_NAME'];

Note:1) will return the FULL path, 2) will return the relative path.

There is only one way to get line number that i know of:

$theline = __LINE__;

But it will quite literally be the line that __LINE__ is used.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux