public static function tidyUrl($string, $bKeepSlashes = true, $bKeepSpaces = false)
	{
		$string = strip_tags($string);
		$string = str_replace([
			'?',
			'&',
			'#',
			'=',
			'+',
			'<',
			'>',
			'"',
			'%'
		], '', $string);
		$string = str_replace("'", ' ', $string);
		$string = preg_replace('/[\s]+/u', ' ', trim($string));

		if (!$bKeepSlashes) {
			$string = str_replace('/', '-', $string);
		}

		if (!$bKeepSpaces) {
			$string = str_replace(' ', '-', $string);
		}

		$string = preg_replace('/[-]+/', '-', $string);

		# Remove path changes in URL
		$string = preg_replace('%^/%', '', $string);
		$string = preg_replace('%\.+/%', '', $string);

		return $string;
	}