静心斋 2016-03-11
问题描述:
原始数据 (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}