How to get the first n words from text stored in my DB in PHP?

Posted by SzamDev on Stack Overflow See other posts from Stack Overflow or by SzamDev
Published on 2010-06-10T10:36:39Z Indexed on 2010/06/10 10:42 UTC
Read the original article Hit count: 178

Filed under:
|
|

Hi

I need to know how to get the first n words from text stored in my DB in PHP?

for example if there is some text in my DB like this one :

"word1 word2 word3 word4 text one test four five"

How I can get the first 4 or five words from this text?

Thnks in Advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql