Counting Rows in textarea
Posted by Johan Cyprich on 29 Jan 2008 | Tagged as: Programming
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
$textarea = $_POST['ta'];
$check = explode("\n", $textarea);
$lines = count($check);
echo "Lines: $lines";
| Related posts: | |
|
|
Share this post:
Follow Me:
Did you find this post interesting and useful? You can keep up to date on this blog by subscribing to my RSS feed, or you can have new posts sent to you by e-mail. You can also follow me on Twitter.
No Comments »















