i n*_*elp 0 html html-entities
在搜索互联网一段时间后,我发现有很多在线工具允许从符号转换为html号码,但反之亦然.
我正在寻找工具/在线工具/ PHP脚本从html号码转换回符号
例如:
& -> &
Run Code Online (Sandbox Code Playgroud)
然后回到
& -> &
Run Code Online (Sandbox Code Playgroud)
有谁知道这个?
小智 5
你可以在java中使用:
import org.apache.commons.lang.StringEscapeUtils
Run Code Online (Sandbox Code Playgroud)
并使用 StringEscapeUtils.unescapeHtml(String str) method
例如输出:
System.out.println(StringEscapeUtils.unescapeHtml("@"));
@
System.out.println(StringEscapeUtils.unescapeHtml("€"));
-
System.out.println(StringEscapeUtils.unescapeHtml("–"));
€
Run Code Online (Sandbox Code Playgroud)