我需要将html内容插入mysql table.but脚本切割部分html内容.Html内容如下.div data-plugin-lightbox data-plugin-options={delegate: a, type: image, gallery: {enabled: true}} 我无法上传所有co...

我需要将html内容插入mysql table.but脚本切割部分html内容.
Html内容如下.
<div data-plugin-lightbox data-plugin-options='{"delegate": "a", "type": "image", "gallery": {"enabled": true}}'>
我无法上传所有content.mysql表了
只要
<div data-plugin-lightbox data-plugin-options={"
如何将任何html内容插入mysql表.
解决方法:
似乎与双引号相关的问题..你应该逃避json的双引号
<div data-plugin-lightbox data-plugin-options='{\"delegate\": \"a\", \"type\": .......
或者问题可能与你在php中的字符串赋值有关
分配
$sql = "< <div data-plugin-lightbox data-plugin-options='{"delegate": "
打破第二个双引号
沃梦达教程
本文标题为:php – 将html内容插入mysql表


猜你喜欢
- mysql – 在数据库中存储html以供使用有什么缺点? 2023-10-26
- Express框架定制路由实例分析 2023-07-09
- 编写轻量ajax组件第三篇实现 2022-12-15
- vue基础4(完) 2023-10-08
- vue开发之生命周期 2023-10-08
- ajax实现文件异步上传并回显文件相关信息功能示例 2023-02-15
- ECSHOP中实现ajax弹窗登录功能 2023-01-31
- AJAX如何实现无刷新登录功能 2023-01-26
- vue 行为验证码之滑动验证AJ-Captcha使用详解 2023-07-10
- js字符串中空格和换行符(\r,\s,\n,\r\n)浅析 2022-08-30