Showing posts with label Remove last char from the string. Show all posts
Showing posts with label Remove last char from the string. Show all posts

Remove the last char from the string

We can remove the last character from the string using

rtrim($string, $charlist)

Ex: Removing the last "/" from the url: http://sahayamatbogex.blogspot.com/

$string = "http://sahayamatbogex.blogspot.com/"

rtrim($string, "/");

For more ref: