Can my iPhone 6 get a virus from a charger?

I found a charger today and I want to charge my iPhone 56. Is it safe? Will i get a virus or will my phone be hacked?

Only an apple user would ask this. The answer is no.

Nope. Do it. Congratulations on finding a free charger.
You can't get viruses from a charger.

Don't see why that would be the case