Friday, 27 September 2013

replace first and last character in php

replace first and last character in php

A question about php.
If I have variable named $string that contains the word "Testing" I would
like the php code to delete the first and last character. (So the output
would be "esting"). I've tried multiple functions for example str_replace
and substr but so far I've only managed to delete only the first or only
the last character.
I don't know how to delete both the first and last character.

No comments:

Post a Comment