Forums

[closed] Limit a string using substr to 30 characters. (2 posts)

  1. thedawgmartin
    Member
    Posted 4 years ago #

    Hey, I'm trying to use the following to limit my post topics to 30 characters, but it doesn't see to work with the function that retrieves the data.

    <?php
    $post-string = the_title();
    substr($post-string, 0, 30);
    ?>

    Does anyone know how to do this? I would like it to appear like the following:

    "This is a post topic exam..."
    "Here is another post that..." // Cuts off after so many characters and puts three dots.

    Thanks in advance to any advice!

  2. whooami
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic