İlk ve nasıl kaldırılır

1 Cevap php

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.

Örnek:

"/posts/funny-dog/" -> "posts/funny-dog"
"/" -> "" // Because http://www.google.com/ path is a slash
"/categories/politic" -> "categories/politics"

Teşekkürler

1 Cevap

trim( $str, "/" ); en iyi / en hızlı bahis muhtemelen.