Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    150

    Unanswered: String Operations

    Hi,

    I need to show only the the first 100 characters of a string. I dont know how to do this in PHP. What operators should be used?

    My guess is to create something like this:

    If string length<100 then
    print '$string'
    else
    print ' this is the part i'm not sure about '


    Any help?
    Cheers!

    Mr.Crud

    There are 10 kinds of people, ones that understand digital, others that dont

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Try:

    echo substr($yourString, 0, 100);
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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