Hi,
I am having the following problem:
In a repeat region table, that displays all the records from the database table, I want the [text] row to only display the first 100 characters, and only when user goes to detailed page he gets to see the full text.
I have used the following code found on this forum:
<?php
$text = $row_rsevents['text'];
$len = 100;
function chopstring($text,$len,$breaker = " ") {
$vertext = strrchr(substr("$text",0,$len),"$breaker");
$mylen = strlen ($vertext);
$mylen = $len-$mylen;
$newtext = substr($text,0,$mylen);
return $newtext;
}
?>
</strong><?php echo chopstring($text,$len,$breaker = " "); ?><br> </td>
</tr>
That works a treat, exept that it only works in the first displayed record, but all the other records of the repeated region give the following error message:
Fatal error: Cannot redeclare chopstring() (previously declared in /home_new/home/alfredo/journo.com/www/admin/editevent.php:97) in /home_new/home/alfredo/journo.com/www/admin/editevent.php on line 97
Do you know how can Iget this to work on every record?
Thanks,
Vinny