Remove the fragment from a URI (if it has one)
mixed $uri A URI:
string The same URI with the fragment removed
public static function removeFragmentFromUri($uri) {
$pos = strpos($uri, '#');
if ($pos === false) {
return $uri;
}
else {
return substr($uri, 0, $pos);
}
}