Results 1 to 3 of 3

Thread: show only part of mysql row

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default show only part of mysql row

    Hi i would like to show only 60 characters of the {$row['about']} as i would like to make a cut down version of there profile and if people want to see more they click on the more link.

    I have tryed the following,
    {$row.about|stripslashes|nl2br|wordwrap:60:"<br />":true}

    however i don't think i am doing it right.

    If any one can point me in the right direction that would be great.

    THX
    The web in one word.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I believe that either the substr function or strpos function can help.
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Try this:
    Code:
    echo substr($row['about'], 0, 60);

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •