Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Substr help

  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    96
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Substr help

    Hey,
    I would like substr to take off the first 3 characters off of a string.
    Example:
    RE: Blah Blah
    Would be: Blah Blah
    Can someone help me?
    Thanks.
    EDIT:
    Ok I fixed it.
    Last edited by Crisp; 10-23-2009 at 07:34 PM.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Use the start and length parameters

    Example:

    $some_string = substr("Blah Blah", 0, 3);
    Last edited by oracleguy; 10-23-2009 at 07:37 PM. Reason: fixed it to cut off from the start, not the end
    OracleGuy

  • #3
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    I had a similar question.

    I want to check for the word CATEGORY: inside a string which can be CATEGORY: ITEM
    and remove the word CATEGORY: leaving only ITEM inside the string....

    In case the string does not have CATEGORY: before listing the ITEM then nothing happens...

    Thanks


  •  

    Posting Permissions

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