With the help of PHP substr() and strops() functions, we can remove the portion of a string after a certain character.
It is an inbuilt function of PHP which searches a particular piece of text in a string and returns the first occurrence of that text.
It is also an inbuilt function of PHP which returns the part of a string by position.
We find the part of a string after a certain character with the help of above both functions.
?php $string="coding-tag"; $position=strpos($string, "-"); $result=substr($string,intval($position)+1); echo $result; ?