HI
i am storing articles in database as html, my text editor is tinymce. and displaying the contents inside td. now i want to print line number in each line, textarea wrapping is failure here, anybody suggest me a solution
thanks
Bigul
$lines = explode("\n", $text); echo "<pre>"; foreach($lines as $key => $val) { printf('%04d %s', $key + 1, htmlspecialchars($val)); } echo "</pre>\n";
sorry my html code don't have '\n' character
thank u. but my html code not have any "\n" character
"\n" is a newline character (must be in double quotes, not single quotes). If you don't have newlines, then everything would be in one line, so you wouldn't need line numbers. 😉