// Split string on newlines into an array
// explode() is faster but for newlines we want to catch \r\n
$lines = preg_split('/[\r\n]+/', $string, -1, PREG_SPLIT_NO_EMPTY);
// Count number of keys and echo results
echo count($lines);
__________________ Please login or register to view this content. Registration is FREE
□ Programming is like sex: sure, it may give some practical results, but that's not why we do it.