Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Location
    Brasil
    Posts
    247

    * php doubt urgent!

    i want to reduce a text to a perfect number of words.
    I have a text with 1404 chars, and want to reduce this text to a exact numver of chars like 200 and then put the ... like some foruns use in topic posts...
    i dont found this function in php!
    tnkz

    PHP Code:
    <?
    $text 
    "i need this things working fast plz";
    $new funcion($text 25);
    //the 25 is the num of characters ex.
    print $new;
    ?>
    Then return:
    Code:
    i need this things workin
    "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former" Albert Einstein

  2. #2
    Join Date
    May 2002
    Posts
    441
    http://php.net/substr

    You should be able to figure out many possible solutions with the use of substr.

    Example:

    $new = substr( $text, 0, 25 );

  3. #3
    Join Date
    Oct 2004
    Location
    Brasil
    Posts
    247
    Wow
    Thanks a lot,
    I this function im needed.
    Take a look where i put it..
    www.portaleps.com
    My new layout and site.
    When be done i put on Reviews!
    Need some scripts yet!
    "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former" Albert Einstein

  4. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Posting Permissions

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