get the last 3 characters in a string
How do you get the last 3 characters of a string?
I have usernames set up with a 3-character "code" at the end for the type of user... for example, agents are "agt" so their usernames all end in agt
How do I use PHP to catch these letters so that the type can be set while they're logged in?
I need to set
with this 3-character code so that certain pages permissions will be different based on the type of user.
$last3chars = substr($string, -3);
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)