0

在javascript中,我有:

var stop_symbols = $("#words_stop_symbols span").html().split('');
console.dir(stop_symbols);

html:

 <span>*/&amp;^\</span>

当 php 很简单时:

<span>Array
(
    [0] => *
    [1] => /
    [2] => &amp;
    [3] => ^
    [4] => \
)
</span>

但在 DB 我只有性格&

那么这个放大器是从哪里来的呢?

我的最终目标是使用这些字母并为他们获取 charCodestr.charCodeAt(0);

4

4 回答 4

1

“&”是英文字符“&”的名称。&amp;是“&”的 HTML 代码。

于 2013-11-01T22:42:44.423 回答
1

使用html_entity_decode().

<?php
$orig = "I'll \"walk\" the <b>dog</b> now";

$a = htmlentities($orig);

$b = html_entity_decode($a);

echo $a; // I'll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now

echo $b; // I'll "walk" the <b>dog</b> now
?>

来源:http ://www.php.net/manual/en/function.html-entity-decode.php

于 2013-11-01T22:47:20.903 回答
1

我自己回答。改变:

html()修复text()它。

于 2013-11-01T22:55:19.267 回答
0

你只需要改变

var stop_symbols = $("#words_stop_symbols span").html().split('');

var stop_symbols = $("#words_stop_symbols span").text().split('');
于 2015-11-24T20:47:06.000 回答