[PHP] Show only few words that var contains

2001-12-26 Thread Daniel Harik
Hello guys, sorry for spamming with questions today, i have varuable called $intro, it's stores pretty big story, but i want to display say 10 first words. Thank You very much -- Best regards, Daniel mailto:[EMAIL PROTECTED] -- PHP General Mailing List

Re: [PHP] Show only few words that var contains

2001-12-26 Thread Gerard Onorato
Daniel, Here is a rather inelegant way to do this. I am sure there is a better way and I would love for someone to point it out to us. This function simply pulls out the first N words using the space as a delimiter. function firstN($string, $N) { // remove all double and more spaces