开发者

How to display ;amp& in HTML?

开发者 https://www.devze.com 2023-01-26 09:05 出处:网络
I have to display th开发者_如何转开发is exact string in HTML: ;amp& When I try it always changes to \"&\".

I have to display th开发者_如何转开发is exact string in HTML:

;amp&

When I try it always changes to "&".

How to fix that?


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

&


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


I guess you mean &

Why don't you do the following: & ?


;amp& = ;amp&


I guess you meant

&

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

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

&


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


If you want to display this exact string

;amp&

Then you you should do this...

;amp&
0

精彩评论

暂无评论...
验证码 换一张
取 消