Home php how to delete the last string symbol / shorten the line

how to delete the last string symbol / shorten the line

Author

Date

Category

There is a word Pini and It is necessary that the date is

$ a = "dates";
FUNCTION ($ A, 1)

Answer 1, Authority 100%

If you have an extension of the MB_STRING extension, you can do this as follows

& lt;? php
$ a = "dates";
Echo MB_Substr ($ A, 0, -1);

mb_substr () Returns a substring of the first argument, a position is transmitted as the second argument, where the substring begins (in our case, the beginning), and as a second – the length of the substring (the current length of the string is minus one character) .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions