top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to remove the last letter from a string?

0 votes
362 views
How to remove the last letter from a string?
posted Jul 15, 2014 by Amanpreet Kaur

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

There are many ways to do this.Here is probably the simplest method:

$data = "One too many letterss";
$newdata = substr($data,0,-1);
// now 'one too many letters'

answer Jul 16, 2014 by Mohit Sharma
...