I need to get the last character of a string. Say I have "testers" as input string and I want the result to be "s". how can I do that in PHP?
There's no PHP function called "substring", you'll get an error unless you've made your own substring function. Should be "substr".
Rich Adams
2010-04-21 09:52:55
ahh you spoil the whole joke. +8 voting for the wrong answer looks just amazing :)
Col. Shrapnel
2010-04-21 09:56:22
duh…, i meant `substr` of course
knittl
2010-04-21 10:12:20
If you’re using multibyte character encodings like UTF-8, use `mb_substr` (http://php.net/mb_substr) instead.
Gumbo
2010-04-21 10:19:26
+2
A:
there are many ways to do it in PHP
Most common one is to ask google for the substring php
and land on the page full of examples: http://php.net/manual/en/function.substr.php including your case too.
Col. Shrapnel
2010-04-21 09:48:07