Update 'PHP and jQuery - Reduce Long String to Preview Length and Reveal Full Text OnClick.md'
This commit is contained in:
parent
35be5d7968
commit
b4f180878d
|
@ -3,14 +3,11 @@
|
|||
static function ReduceStringForPreview($text,$size=100)
|
||||
{
|
||||
define($reduced,'');
|
||||
if(strlen($text) > $size)
|
||||
{
|
||||
if(strlen($text) > $size){
|
||||
$reduced .= "
|
||||
|
||||
". substr($text, 0, $size);
|
||||
$remaining = substr($text, $size);
|
||||
$reduced .= "...
|
||||
|
||||
";
|
||||
$text = $reduced;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue