Hi I use parse_url() to get the path of a url but i want to remove the first slash & the last if it's exists.
Example:
"/posts/funny-dog/" -> "posts/funny-dog"
"/" -> "" // Because http://www.google.com/ path is a slash
"/categories/politic" -> "categories/politics"
Thanks