if someone could help me to improve this function to use it with this format (from scratch, not tested):
<?php
define("LINEA", __LINE__, true);
function line($string)
{
return $string . LINEA;
}
echo line('Error: ');
?>
Example of current use:
<?php
function line($startText, $line, $endText = NULL)
{
$endText = !empty($endText) ? $endText : '';
return $startText . $line . $endText;
}
/*
...
lot of code
...
*/
echo line('Error on line: ', __LINE__) . '<br />';
/*
...
lot of code
...
*/
echo line('Alert - ', __LINE__, '!');
?>
Outputs:
Error on line: 12
Alert - 18!