php 长整型转字符串 (convert long to string)
问题描述:
原始数据 (before deal)
{"id":5730528714937479169,"fullname":"rourou","email":null,"mobile":"1391730****","description":null}
json_decode后 (after json_decode)
<!--more-->array(5) { ["id"]=> float(5.7305287149375E+18) ["fullname"]=> string(6) "rourou" ["email"]=> NULL ["mobile"]=> string(11) "1391730****" ["description"]=> NULL }
处理方法(deal method)
$response={"id":5730528714937479169,"fullname":"rourou","email":null,"mobile":"1391730****","description":null} preg_replace('/^\{"id":(\d{1,})./', '{"id":"\\1",', $response);
处理后(after deal)
$response={"id":"5730528714937479169","fullname":"rourou","email":null,"mobile":"1391730****","description":null}
相关推荐
卖口粥湛蓝的天空 2020-09-15
stulen 2020-09-15
Lzs 2020-10-23
聚合室 2020-11-16
零 2020-09-18
Justhavefun 2020-10-22
jacktangj 2020-10-14
ChaITSimpleLove 2020-10-06
Andrea0 2020-09-18
周游列国之仕子 2020-09-15
afanti 2020-09-16
88234852 2020-09-15
YClimb 2020-09-15
风雨断肠人 2020-09-04
pythonxuexi 2020-09-06
abfdada 2020-08-26
梦的天空 2020-08-25