note 39251 deleted from function.substr-count by nlopess
| From: | nlopess@php.net | Date: | Thu, 22 Jan 2004 15:14:55 +0000 |
| Subject: | note 39251 deleted from function.substr-count by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64023@lists.php.net to get a copy of this message | ||
Note Submitter: jpicard nospamAT lynchdigital dot com
----
This function is useful to find out the number of new line characters are used in a string - for
example, before using nl2br() or <pre>. It can also be used for paging text by the number of
new lines created by wordwrap($text,75)
function str_lines($str) {
return substr_count($str,"\n");
}