Here, we print the line number using the __LINE__ magic constant on the webpage.
Program/Source Code:
The source code to print line number using __LINE__ magic constant is given below. The given program is compiled and executed successfully.
<?php //PHP program to print line number //using __LINE__ constant. print ("Line : " . __LINE__ . "<br>"); print ("Line : " . __LINE__ . "<br>"); print ("Line : " . __LINE__ . "<br>"); print ("Line : " . __LINE__ . "<br>"); ?>
Output:
Line : 3 Line : 4 Line : 5 Line : 6
Explanation:
In the above program, we used magic constant __LINE__ 4 times that will print line numbers on the webpage.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Program/Source Code:
The source code to print line number using __LINE__ magic constant is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we used magic constant __LINE__ 4 times that will print line numbers on the webpage.
need an explanation for this answer? contact us directly to get an explanation for this answer