[thelist] PHP show first 10 words of MySQL field

Austin Harris austin at dotmail.co.uk
Wed Aug 27 15:29:45 CDT 2003


Sorry for the poor title but I am not sure how to describe what I want to do
concisely...

I have a text field in a db and want to show on one page just the first 20
words, (more or less) of that field before putting a "view more" link.

Being relatively new to PHP I am not sure what sort of function I need to
use, searching is tricky without being able to state the problem concisely!

I am guessing I want to count the words, (or characters) and set a cut off
limit.

All help very much appreciated.

Austin



More information about the thelist mailing list