in reply to String matching problem

Admittedly it doesn't answer the question that was asked, but it may be worth pointing out that substr($string, -1) will return the last character in $string.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: String matching problem
by FunkyMonk (Bishop) on May 08, 2007 at 16:18 UTC
    substr($string, -1) will return the last character in $string.
    As does chop $string. I think that's the first time I've used chop.
Re^2: String matching problem
by cool (Scribe) on May 08, 2007 at 14:13 UTC

    Actually its second last character not the last one... so I think

    substr($string, -2, 1)

    would be more appropriate

      Actually its the last character. I used double codes to just suggest that its a string. Thanks everyone for the help!