I know about str_pad but is there an opposite to it. With str_pad you can add characters to a string, but what if I want to take characters away. Like I want to only display the first 25 characters and then three dots(...)if the string is longer. Is there a function for that?

    if(strlen($string) > 25)
    {
       echo substr($string, 0, 25) . "...";
    }
    else
    {
       echo $string;
    }
    
      Write a Reply...