Found this in one of my old applications ... Not sure where I got it from.
$lines_arr = preg_split('/\n|\r/',$str); $num_newlines = count($lines_arr); echo $num_newlines;
* Edit - Actually, this probably won't work if your text box spits out html .. check <br> and <br/>
K2xL source share