PHP characters limitation

Characters limitation will helps to display limited number of characters to display.

[php]
function limit_characters( $str, $n )
{
if ( strlen ( $str ) <= $n )
{
return $str;
}
else {
return substr ( $str, 0, $n ) . ‘…’;
}
}
[/php]

Permanent link to this article: https://blog.openshell.in/2011/09/php-characters-limitation/

Leave a Reply

Your email address will not be published.