public static function remove($string, $toRemove)
    {
        $string = is_int($string) ? "$string" : $string;
        $toRemove = is_int($toRemove) ? "$toRemove" : $toRemove;
        if (is_null($string) || is_null($toRemove)) {
            return $string;
        }
        return str_replace($toRemove, '', $string);
    }
public static function remove($string, $toRemove)
    {
        $string = is_int($string) ? "$string" : $string;
        $toRemove = is_int($toRemove) ? "$toRemove" : $toRemove;
        if (is_null($string) || is_null($toRemove)) {
            return $string;
        }
        return str_replace($toRemove, '', $string);
    }
public static function remove ( $ string , $ toRemove ) { $ string = is_int ( $ string ) ? "$string" : $ string ; $ toRemove = is_int ( $ toRemove ) ? "$toRemove" : $ toRemove ; if ( is_null ( $ string ) || is_null ( $ toRemove ) ) { return $ string ; } return str_replace ( $ toRemove , '' , $ string ) ; }
Removes all occurrences of a substring from string.

Example:
<code>
$string = 'winter is coming???!!!';
$result = Strings::remove($string, '???');
</code>
Result:
<code>
winter is coming!!!
</code>

@param string $string
@param string $toRemove
@return mixed
Removes all occurrences of a substring from string .