谢谢@Scott Gottreu和@pospi。
答案是在最后评论中关于该问题的公认答案。
使用preg_replace()函数将所有整数值都用引号引起来。
json_depre(preg_replace('/("w+"):(d+)/', '\1:"\2"', $jsonString), true);实际上,在测试了上述代码后,它使用浮点数将JSON固定为值,为解决该问题,我使用以下内容将所有数字(整数或浮点数)括在引号中:
json_depre(preg_replace('/("w+"):(d+(.d+)?)/', '\1:"\2"', $jsonString), true);


