in reply to removing first char of string

Or maybe . .
$string = reverse(chop(reverse($string)));
Doh! Thanks ihb.
chop(reverse$string)); $string = reverse($string);
Note to self: Don't offer advice while drinking beer...

Sorry all.

Replies are listed 'Best First'.
Re: Re: removing first char of string
by ihb (Deacon) on Feb 10, 2003 at 03:06 UTC

    You didn't actually try that, did you? :)

    It won't work, and that's because chop() tries to modify its argument, i.e. it wants an lvalue. The return value of chop() returns the (last) removed value, so even if chop() could chop the reverse()-expression $string would hold the first char of itself, and the outer reverse would be useless.

    ihb