in reply to Re: remove the part of the string that is after the second to last '/'
in thread remove the part of the string that is after the second to last '/'

You weenie! You used a regular expression! :)

I think I like this way of avoiding regexes better:
substr($var, rindex($var, '/', length($var) - 2)) = '';

++ vs lbh qrpbqrq guvf hfvat n ge va Crey :)
Nabgure bar vs lbh qvq fb jvgubhg ernqvat n znahny svefg.
-- vs lbh hfrq OFQ pnrfne ;)
    - Whreq

  • Comment on Re: Re: remove the part of the string that is after the second to last '/'
  • Download Code