Web Analytics Made Easy -
StatCounter getting the line number of the current echo line, how? - CodingForum

Announcement

Collapse
No announcement yet.

getting the line number of the current echo line, how?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getting the line number of the current echo line, how?

    I would like to echo the line where the echo command is, how to do this?

    PHP Code:
    <?php

    echo line_number();

    ?>
    Something like that, it should return now '3'.
    PHP 5 & MySQL 5 (Y)

  • #2
    Use the __LINE__ magic constant.
    PHP Code:
    <?php
    echo __LINE__;
    ?>
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

    Comment


    • #3
      Thank you marek, I remembered there is a command but needed someone to remind me
      PHP 5 & MySQL 5 (Y)

      Comment

      Working...
      X