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
边栏推荐
- Reading of denoising paper - [ridnet, iccv19] real image denoising with feature attention
- 去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots
- Create binary tree
- Solve the error: importerror: iprogress not found Please update jupyter and ipywidgets
- Ptorch learning record (XIII): recurrent neural network
- Development environment EAS login license modification
- A general U-shaped transformer for image restoration
- 编程记录——图片旋转函数scipy.ndimage.rotate()的简单使用和效果观察
- 治疗TensorFlow后遗症——简单例子记录torch.utils.data.dataset.Dataset重写时的图片维度问题
- Treatment of tensorflow sequelae - simple example record torch utils. data. dataset. Picture dimension problem when rewriting dataset
猜你喜欢

Linear algebra Chapter 1 - determinant

Pytorch learning record (III): structure of neural network + using sequential and module to define the model

PyEMD安装及简单使用

Fundamentals of digital image processing (Gonzalez) II: gray transformation and spatial filtering

Pytorch学习记录(五):反向传播+基于梯度的优化器(SGD,Adagrad,RMSporp,Adam)

Pytoch learning record (x): data preprocessing + batch normalization (BN)

数字图像处理基础(冈萨雷斯)一

线性代数第二章-矩阵及其运算

Create binary tree

Pyqy5 learning (2): qmainwindow + QWidget + qlabel
随机推荐
开发环境 EAS登录 license 许可修改
Chapter 4 of line generation - linear correlation of vector systems
Anaconda
LDCT图像重建论文——Eformer: Edge Enhancement based Transformer for Medical Image Denoising
字符串(String)笔记
Development environment EAS login license modification
The user name and password of users in the domain accessing the samba server outside the domain are wrong
Preparedstatement prevents SQL injection
Get the value of state in effects in DVA
JDBC operation transaction
Pytorch learning record (XII): learning rate attenuation + regularization
去噪论文阅读——[CVPR2022]Blind2Unblind: Self-Supervised Image Denoising with Visible Blind Spots
线性代数第二章-矩阵及其运算
Graphic numpy array matrix
Practical operation - Nacos installation and configuration
Comparative study paper - [Moco, cvpr2020] momentum contract for unsupervised visual representation learning
The attendance client date of K / 3 wise system can only be selected to 2019
Illustrate the significance of hashcode
RedHat realizes keyword search in specific text types under the directory and keyword search under VIM mode
Anaconda安装PyQt5 和 pyqt5-tools后没有出现designer.exe的问题解决