Using __FILE__ and __LINE__ : __LINE « File Directory « PHP






Using __FILE__ and __LINE__

 
<?php
    function report_error($file, $line, $message) {
        echo "An error occured in $file on line $line: $message.";
    }
    report_error(__FILE__,__LINE__, "Something went wrong!");
?>
  
  








Related examples in the same category

1.Echoing the line and file predefined constants