9951 explained code solutions for 126 technologies


phpRemove any last character from a string


$new_str = substr($str, 0, -1);ctrl + c
$new_str

string without last character will be saved here

substr

function to extract part of the given string

$str

original string to remove last character from

0,

extract substring starting from beginning of original string ...

-1)

... and ending one character prior to the end of the original string