Saturday 31 August 2013

Remove a single or multiple trailing or leading characters from a string using rtrim:

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