Line lenght limitations

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marcoq
Forum Newbie
Posts: 1
Joined: Mon Nov 18, 2002 11:55 pm

Line lenght limitations

Post by marcoq »

Hello folks I am new to PHP and looking for a code which will allow me to limit the lenghts of lines.

I am using a table 190.px wide and if the content of the table is too long i want the PHP code make it appear like this

text text text text text text text text text text [...]

Can anyone help me with this please..

Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

e.g.

Code: Select all

if (strlen($text) > 30)
	$text = substr($text, 0, 30) . 'ї...]';
echo $text;
http://www.php.net/manual/en/function.strlen.php
http://www.php.net/manual/en/function.substr.php
Post Reply