Re: Class for determining word count, ignoring HTML?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 21 Nov 2004 09:10:37 +1000, Murray @ PlanetThoughtful
<lists@xxxxxxxxxxxxxxxxxxxx> wrote:
> Hi All,
> 
> Just wondering if anyone knows of a class that can perform a word count of
> text in a string that ignores HTML?
> 
> IE, something that would correctly determine that the following string is 6
> words long:
> 
> "<blockquote>
> 
> This string is six words long.
> 
> </blockuote>"

Use strip_tags() to remove the html, then explode() the string by a
space, then count() the exploded array.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux