I'm trying to make a url safe for later use. So I want to strip the slashes from the end of the url string.
Actually I'm doing:
function getUrl() {
$url = "url/with/ending/slashes///";
if(..someConditions..) {
$url = false;
}
return $url
}
$a = getUrl();
while($a !== $a = rtrim($a, '/'));
So the string can have a string value or a boolean value
There will be any unexpected result or downside when dealing with unexpected values of the string? (like specific strings, booleans values, integers, etc.?)