I need to test a string to see if the last character in it is a "!".
If the last character is "!" then I wanna do something.
How do I test for the last character?
Hi,
you can use the substr() function
if (substr($thestring, -1) == "!") { // do something }
http://www.php.net/manual/en/function.substr.php
Thanks!