<html lang="en">
<head>
<meta charset="utf-8">
<title>Remove Specific Characters from the End of a String in PHP</title>
</head>
<body>
// Sample string
$str = " ++--\tHello World!++-- ";
// Stripping characters from the end
$rtrimmed_str = rtrim($str, " +-");
echo "<b>Before:</b>";
echo "<pre><mark>$str</mark></pre>";
echo "<b>After:</b>";
echo "<pre><mark>$rtrimmed_str</mark></pre>";