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.
Filename: t.php


Filename: t_handler.php

<?php
$textarea = $_POST['ta'];
$check = explode("\n", $textarea);
$lines = count($check);
echo "Lines: $lines";

Translate ยป
%d bloggers like this: