Hi
I'm trying to display a series for recordsets from a mysql database but limit the amount of words from one field to be displayed on the page. I have used the following code to limit the words but I have tried using different looping techniques to display the records but I get a Cannot redeclare limit_words() error message.
Could someone tell me hthe correct looping code required.
Thanks
<?php
function limit_words($string, $word_limit)
{
$words = explode(" ",$string);
return implode(" ",array_splice($words,0,$word_limit));
}
$content = $row_Details['Message'];
echo limit_words($content,10);
?>