I wrote a snippet which counts the number of rows of text in an HTML textarea object. Its very useful if you need to display data outside of the textarea box.
I’ve got an example of a form and the PHP function it calls.
$textarea = $_POST['ta'];
$check = explode("\n", $textarea);
$lines = count($check);
echo "Lines: $lines";