0

I'm trying to put a php variable in a button data attribute however weird characters are showing up instead of the punctuation. As an example instead of an apostraphe ' is showing up instead. The variable is normal everywhere else on the page. How can I fix this?

<button id="coolButton"data-name="<?PHP echo $name;?>"
4

2 に答える 2

2

id の末尾と data-name の先頭の間にはスペースが必要です

<button id="coolButton" data-name="<?PHP echo $name;?>"
于 2015-09-23T12:57:52.967 に答える