|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
display 7 words from blob field
hi all i have this script wich counts to see how many words and if its more than 7 it writes ...more.
<? echo (str_word_count($content) > 7) ? $content.'<span class="body"><a href="news.php"> ...more</a></span>' : $content; ?> hoe can i now only display 7 words from the same field. cheers aron. |
|
#2
|
|||
|
|||
|
Presuming the words are divided by a space or some other delimiter you can use the split function (more info at www.php.net since its early and I can't remember the arguments it expects) which will give you an array of words then you can do a for loop to print out the first 7 (or however many you want).
Hope this helps, -KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > display 7 words from blob field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|