python、php的html编码解码 Posted on 15 8 月, 2021 Updated on 8 12 月, 2022 php: 编码(入数据库):htmlspecialchars() /解码(读数据库): htmlspecialchars_decode() python: 首先要import html,然后 content = html.escape(content) # 对html进行转码,再入数据库 python 读取数据库,用content = html.unescape(content) 即可成为html,然后再显示。 Post Views: 101