|
Posted by d on 02/14/06 17:33
"Mikey P" <phatnugs420@comcast.net> wrote in message
news:1139928542.712778.211530@g47g2000cwa.googlegroups.com...
> basically i have a description in a mysql table. Is there any way to
> pull say like the first 10-20 words for a brief description?
If you want an actual count of words, you can do this:
$brief=join(" ", array_slice(explode(" ", $description), 0, 10));
where $description is your long description, and 10 is how many words you
want. Bear in mind usually you'd work out how long your short description
should be on its letter-count, as that's more accurate (though still not
pixel-accurate, obviously).
> Thanks so much,
> Mike
>
Navigation:
[Reply to this message]
|