Page 1 of 1

Line lenght limitations

Posted: Mon Nov 18, 2002 11:55 pm
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

Posted: Tue Nov 19, 2002 2:30 am
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