public static function trim($string, $side = self::TRIM_BOTH, $chars = null)
    {
        if ($side == self::TRIM_START) {
            return ltrim($string, $chars);
        } elseif ($side == self::TRIM_END) {
            return rtrim($string, $chars);
        } elseif ($side == self::TRIM_BOTH) {
            return trim($string, $chars);
        }
    }
public static function trim($string, $side = self::TRIM_BOTH, $chars = null)
    {
        if ($side == self::TRIM_START) {
            return ltrim($string, $chars);
        } elseif ($side == self::TRIM_END) {
            return rtrim($string, $chars);
        } elseif ($side == self::TRIM_BOTH) {
            return trim($string, $chars);
        }
    }
public static function trim ( $ string , $ side = self :: TRIM_BOTH , $ chars = null ) { if ( $ side == self :: TRIM_START ) { return ltrim ( $ string , $ chars ) ; } elseif ( $ side == self :: TRIM_END ) { return rtrim ( $ string , $ chars ) ; } elseif ( $ side == self :: TRIM_BOTH ) { return trim ( $ string , $ chars ) ; } }
Trim a string.

@param string $string
@param string $chars
@param string side

@return string
Trim a string .