PDA

View Full Version : getting the line number of the current echo line, how?


kaisellgren
10-06-2006, 04:32 PM
I would like to echo the line where the echo command is, how to do this?

<?php

echo line_number();

?>

Something like that, it should return now '3'.

marek_mar
10-06-2006, 06:47 PM
Use the __LINE__ magic constant.

<?php
echo __LINE__;
?>

kaisellgren
10-06-2006, 08:49 PM
Thank you marek, I remembered there is a command but needed someone to remind me :)