php remove first and last char 1

php remove first and last char

Here is what the above code is Doing:
1. We create a string called $string.
2. We create a new string called $trimmed.
3. We use the substr() function to create a substring of $string.
4. We pass 3 arguments to the substr() function:
a. The string we want to create a substring from.
b. The starting position of the substring.
c. The length of the substring.
5. We print the $trimmed string.

Similar Posts