#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    I am a newbie to php and i am trying to fetch a portion of a message.
    I tried using the boundary as the message part but that print the whole thing.

    can some one point me in the right direction

    Thanks in advance
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    You may use substr() function to achive that.

    Here is an example:
    <?
    $message="hello this is the text";

    //if i want to some portion of above message the i may try like this:

    $portion_message=substr($message,8);
    //this will return 'this is the text'.

    //if i want to specify the limit for the display then i try.

    echo $portion_message;

    $portion_message=substr($message,8,4);
    //substr('string',start,length).
    //this will return 'this'.
    echo $portion_message;

    ?>

    See the manual for more details about the substr() function..





    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

Similar Threads

  1. Bob's Auto Parts
    By nicknike in forum PHP Development
    Replies: 1
    Last Post: January 19th, 2004, 05:40 PM
  2. please help, constant error messages
    By Agent_J in forum Windows Help
    Replies: 0
    Last Post: January 1st, 2004, 03:00 AM
  3. Aligning messages in date and then message ID order
    By rapidwiz in forum MySQL Help
    Replies: 2
    Last Post: October 26th, 2003, 03:15 AM
  4. problem fetching the total number of rows newbie
    By shirley_sing in forum MySQL Help
    Replies: 5
    Last Post: September 23rd, 2003, 11:02 AM
  5. Bill of parts?
    By Axoliien in forum Database Management
    Replies: 2
    Last Post: July 20th, 2003, 08:24 PM

IMN logo majestic logo threadwatch logo seochat tools logo