返回首頁
當前位置: 主頁 > 網絡編程 > Php實例教程 >

php 長整型轉字符串 (convert long to string)

時間:2018-11-24 22:33來源:知行網www.f1globe.com 編輯:麥田守望者

問題描述:

原始數據 (before deal)
{"id":5730528714937479169,"fullname":"rourou","email":null,"mobile":"1391730****","description":null}

json_decode后 (after json_decode)
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}

------分隔線----------------------------
標簽(Tag):php 長整型轉字符串
------分隔線----------------------------
推薦內容
猜你感興趣
99久久免费高清热精品