Voodoo\Core\Helpers::removeUrl PHP Method

removeUrl() public static method

public static removeUrl ( $data )
    public static function removeUrl($data)
    {
        // remove url + email
        $lines = explode("\n", $data);
        while (list($key, $line) = each($lines)) {
            $line = eregi_replace("([ \t]|^)www\\.", " http://www.", $line);
            $line = eregi_replace("([ \t]|^)ftp\\.", " ftp://ftp.", $line);
            $line = eregi_replace("((http://|https://|ftp://|news://)[^ )\r\n]+)", "", $line);
            $line = eregi_replace("([-a-z0-9_]+(\\.[_a-z0-9-]+)*@([a-z0-9-]+(\\.[a-z0-9-]+)+))", "", $line);
            if (empty($newText)) {
                $newText = $line;
            } else {
                $newText .= "\n{$line}";
            }
        }
        return $newText;
    }