Antibacterial properties of magnesium in an in vitro and in vivo