How to keep specific tag from an html string?

I had to ask to finally find the solution, lol.

The wp_kses do exactly that:

$allowed_tags = array(
    'a'      => array(
        'href'      => array(),
    ),
);
$content="<a href="#">link</a> <b>strong text</b>";
$content = wp_kses($content, $allowed_tags);

I found the solution in another topic

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)