How to use _LINE_ in PHP to display current line of execution

时间:2015-07-28 15:38:29

标签: php

I am studying PHP and in my book one line given that is :

"using echo _LINE_ at a specific location in a script will display the current line that's executing"

I tried the code echo _LINE_; but this will gives me Notice

Here is NOTICE :

Notice: Use of undefined constant LINE - assumed 'LINE' in C:\wamp\www\New\index.php on line 17

I don't understand how this work please anyone suggest...

2 个答案:

答案 0 :(得分:3)

You have to use :

echo __LINE__; 

with two underscores.

答案 1 :(得分:0)

I assume you need to use:

<?php

echo __LINE__;

?>

NOTE:Double underscore not single underscore.