1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Dropping the last character of a string.

Discussion in 'PHP' started by duilen, Jul 25, 2006.

  1. #1
    I would like to turn a variable like this.
    $var = "sample1";

    Into this.
    $var = "sample";
    SEMrush
    As far as I know str_replace wont work because the final character and the preceding characters will constantly vary.
     
    duilen, Jul 25, 2006 IP
    SEMrush
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    tflight, Jul 25, 2006 IP
    duilen likes this.
  3. duilen

    duilen Active Member

    Messages:
    354
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Thanks, this is exactly what I was looking for.
     
    duilen, Jul 25, 2006 IP