PHP

Remove first and last character from a string - PHP

  • php

1 comments

There are multiple ways of doing it. One of which is this:

$string = "12121";
substr($string,1);
$trimmed = trim($string, 1);
print($trimmed);