#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    108
    Rep Power
    15
    Hello.

    Is there a way for me to cut off part of a string (in a variable) after a number of characters, then add on to the string "..."?

    Thanks!
    yoshi
    datera@datera.com http://www.datera.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    You can cut your part of a string using the substr function then you can concactenate something to the end.

    $string1 = "This is a very big house";
    $string2 = "small house";

    $string1 = substr($string1, 0, 15);

    //Now string1 looks like "This is a very "
    $string1 = $string1 . $string2;

    // Now $string1 reads "This is a very small house"

    Good Luck!

Similar Threads

  1. help with tables and wordwrapping
    By junkedBrian613 in forum PHP Development
    Replies: 2
    Last Post: February 15th, 2004, 06:42 PM
  2. cut off text at previous space in string
    By PHPme in forum PHP Development
    Replies: 1
    Last Post: February 3rd, 2004, 02:21 PM
  3. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 07:19 PM
  4. float question
    By yeah-yeah in forum HTML Programming
    Replies: 10
    Last Post: January 15th, 2004, 04:59 PM
  5. Javascript scrollbar - stuck on last bit
    By NayMyoSan in forum JavaScript Development
    Replies: 0
    Last Post: January 3rd, 2004, 01:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo