We often use JSON.stringify() Save some data , Then it needs to be in php Read from , But in PHP When receiving the data of this parameter , Use json_decode() But it can't be parsed .
So the problem is , Why? json_decode() analysis JSON.stringify Why NULL.
resolvent :
When you use JSON stringify when , First in json_decode Before using html_entity_decode.
Code example :
$tempData = html_entity_decode($tempData);
$cleanData = json_decode($tempData);
html_entity_decode(string,flags,character-set) Function HTML Entity to character , yes htmlentities() Inverse function of function .
string It's necessary . Specify the string to decode .
flags
Optional . Specify how quotation marks are handled and which document type to use .
Available quote types :
ENT_COMPAT - Default . Decode only double quotes .
ENT_QUOTES - Decode double and single quotation marks .
ENT_NOQUOTES - Don't decode any quotes .
The type of document used in addition to flags:
ENT_HTML401 - Default . As HTML 4.01 Processing code .
ENT_HTML5 - As HTML 5 Processing code .
ENT_XML1 - As XML 1 Processing code .
ENT_XHTML - As XHTML Processing code .
character-set
Optional . A string value , Specify the character set to use .
Allowed value :
UTF-8 - Default .ASCII Compatible with multi byte 8 position Unicode
ISO-8859-1 - Western Europe
ISO-8859-15 - Western Europe ( Add the euro symbol + ISO-8859-1 Missing French and Finnish letters in )
cp866 - DOS special Cyrillic Character set
cp1251 - Windows special Cyrillic Character set
cp1252 - Windows Dedicated Western European character set
KOI8-R - Russian
BIG5 - Traditional Chinese , Mainly used in Taiwan
GB2312 - Simplified Chinese , National standard character set
BIG5-HKSCS - With Hong Kong expansion Big5
Shift_JIS - Japanese
EUC-JP - Japanese
MacRoman - Mac The character set used by the operating system
notes : stay PHP 5.4 Previous version , Unrecognized character sets will be ignored and replaced by ISO-8859-1 replace . since PHP 5.4 rise , Unrecognized character sets will be ignored and replaced by UTF-8 replace .
当前位置:网站首页>PHP processing JSON_ Decode() parses JSON stringify
PHP processing JSON_ Decode() parses JSON stringify
2022-04-23 06:06:00 【fusheng-fate】
版权声明
本文为[fusheng-fate]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230539253215.html
边栏推荐
- Postfix变成垃圾邮件中转站后的补救
- redhat实现目录下特定文本类型内关键字查找及vim模式下关键字查找
- Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
- sklearn之 Gaussian Processes
- MySQL basic madness theory
- PyTorch笔记——观察DataLoader&用torch构建LeNet处理CIFAR-10完整代码
- 数据处理之Numpy常用函数表格整理
- C3p0 database connection pool usage
- 实操—Nacos安装与配置
- 无监督去噪——[TMI2022]ISCL: Interdependent Self-Cooperative Learning for Unpaired Image Denoising
猜你喜欢
Comparative study paper - [Moco, cvpr2020] momentum contract for unsupervised visual representation learning
LDCT图像重建论文——Eformer: Edge Enhancement based Transformer for Medical Image Denoising
关于二叉树的遍历
Graphic numpy array matrix
建表到页面完整实例演示—联表查询
PyQy5学习(二):QMainWindow+QWidget+QLabel
Anaconda
线代第四章-向量组的线性相关
Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
Pytorch学习记录(十一):数据增强、torchvision.transforms各函数讲解
随机推荐
去噪论文——[Noise2Void,CVPR19]Noise2Void-Learning Denoising from Single Noisy Images
图解numpy数组矩阵
Use Matplotlib. In Jupiter notebook Pyplot server hangs up and crashes
ValueError: loaded state dict contains a parameter group that doesn‘t match the size of optimizer‘s
Gaussian processes of sklearn
Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
Pytorch learning record (7): skills in processing data and training models
Pytorch学习记录(十二):学习率衰减+正则化
去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots
Pyqy5 learning (III): qlineedit + qtextedit
Ptorch learning record (XIII): recurrent neural network
自动控制(韩敏版)
线性代数第三章-矩阵的初等变换与线性方程组
Chapter 4 of line generation - linear correlation of vector systems
Pytorch学习记录(九):Pytorch中卷积神经网络
Automatic control (Han min version)
Multithreading and high concurrency (3) -- synchronized principle
Traitement des séquelles du flux de Tensor - exemple simple d'enregistrement de torche. Utils. Données. Dataset. Problème de dimension de l'image lors de la réécriture de l'ensemble de données
Pytorch introduction notes - use a simple example to observe the output size of each layer of forward propagation
Contrôle automatique (version Han min)