I have a hard time getting around regular expressions and I'm trying to remove the last forward slash in a string :
$public_url = "https://api.mongohq.com/";
What I intend is remove the last forward slash and replace it with something else. I figured I could use preg_replace
but I cannot find the right pattern for doing it.