json_decode return value is NULL solution

  1. Use json_last_error error value is determined and the corresponding error cause. File
  2. If it is 3, the following manner may be used to filter out non-utf8 character.
preg_match('/[\x00-\x1F\x80-\x9F]/u', $str, $match);
// 将得到字符串 base64 转码即可找到该不可显示的特殊字符

Find special characters \u001f
found is stored in mysql json field this field will be displayed as visible characters.

And finally found the problem with the older version bug, recorded above.
mysql Description: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-21.html

reference:

  1. https://www.cnblogs.com/wt645631686/p/8419932.html

Guess you like

Origin blog.csdn.net/qq_35958788/article/details/92410581