fomicz
fomicz

Reputation: 1792

How to display ;amp& in HTML?

I have to display this exact string in HTML:

;amp&

When I try it always changes to "&".

How to fix that?

Upvotes: 4

Views: 14110

Answers (7)

cyber-guard
cyber-guard

Reputation: 1846

There is also the html entity for ampersand - &, so if you want to print &, just use &

Upvotes: 1

Ryan Berger
Ryan Berger

Reputation: 9732

If you want to display this exact string

;amp&

Then you you should do this...

;amp&

Upvotes: 0

Aurel Bílý
Aurel Bílý

Reputation: 7973

I guess you meant

&

Because that DOES change into "&". Anyway - you will have to escape the ampersand.

So - replace "&" with "&" like:

&

Upvotes: 1

migajek
migajek

Reputation: 8614

I guess you mean &

Why don't you do the following: & ?

Upvotes: 3

ajreal
ajreal

Reputation: 47321

;amp& = ;amp&

Upvotes: 2

cdhowie
cdhowie

Reputation: 169123

Assuming you actually meant &, you just need to escape the &: use the HTML code &.

Upvotes: 4

John Kugelman
John Kugelman

Reputation: 361749

If you mean &, then you need to double escape it:

&

Upvotes: 13

Related Questions