Ok I am doing a lil message system for a project. And when you visit the main page where all the messages are displayed, i want to limit one of the fields displayed so that the page doesnt stech and mess up.
If you are not sure i will add a screenshot in about an hour when i am home
thanks
Limiting the size of the result
Started by Mr. Matt, Nov 29 2005 10:52 AM
4 replies to this topic
#1
Posted 29 November 2005 - 10:52 AM
#2
Posted 29 November 2005 - 11:21 AM
What do you mean limit? Cut-off the message or make it go to a new line after several chars?
#3
Posted 29 November 2005 - 11:52 AM
yea cut of the message say after 30 characters so they can get a preview of the msg
#4
Posted 29 November 2005 - 02:11 PM
Try this function:
<?php
function cut_off( $txt )
{
$txt = substr( $txt, 0, 30 );
$txt .= '...';
return $txt;
}
?>
#5
Posted 29 November 2005 - 02:56 PM
ah thanks mate

had to play around with it a lil to get it to fully work with wht i am doing but still works great
cheeres
had to play around with it a lil to get it to fully work with wht i am doing but still works great
cheeres
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
