Error Php shorten text function, need correction -


i'm not sure i'm missing.

i've try looking @ syntax , miss spelling function name

but seems can't find problems

the problem come line 4 coding

<?php      function shortentext($text, $maxlength=70, $appendix = "..."){         $text = strip_tags($text);         if(mb_strlen($text) <= $maxlength){return $text;}          $text = mb_substr($text, 0, $maxlength - mb_strlen($appendix));         $text =. $appendix;         return $text;     }  } 

you closed twice function , have put =. instead of .= use ide, underline errors...

function shortentext($text, $maxlength=70, $appendix = "...") {     $text = strip_tags($text);     if(mb_strlen($text) <= $maxlength){return $text;}      $text = mb_substr($text, 0, $maxlength - mb_strlen($appendix));     $text .= $appendix;     return $text; } 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -