<?php
$str="a-b-c-d-f-";
$new= trim($str, "-"); // it will remove last character fromstring where "-" is putted
echo $new; // Output will be :- "a-b-c-d-e-f"
?>
<?php
$strng= "Hey you!";
echo rtrim($strng,"you!"); // will remove word from string
// Output will be :- Hey
?>
Type your Comment below and click to send comment