I have following example PHP code and its working great! but i just want one more addition so it print line number too.
<?php
$path = shell_exec('cat data.txt');
$path = chop($path,"\n");
$lines = explode("\n",$path);
echo "<h2><a href=\"http:\"\" title=\"Summery\">List of Studies</a></h2>";
foreach($lines as $line) {
echo "<h3><p>$line</p></h3>";
}
?>
Output:
ABC
XYZ
123
I want following addition and add counter in it.
1. ABC
2. XYZ
3. 123
filefunction? It will automatically split lines for you