Remove a single or multiple trailing or leading characters from a string using rtrim:
Without the second argument rtrim will remove trailing and and trim will remove leading and trailing whitespace.
rtrim($string, ",")
would cut trailing commas.trim($string, ",")
would cut trailing and prefixing commas.Without the second argument rtrim will remove trailing and and trim will remove leading and trailing whitespace.
No comments:
Post a Comment