我已经将我的XML文档汇总为一个数组,希望对reg_exp
魔术有所帮助。
这是我的数组的示例:
[64] => "200004008993","PART":"1003261894","VKN":"28445521001","INK":"00000000000101926661","BP":"0000000101","DAT":"20190823","ENDAT":"20190826","UPTDAT":"00000000","CLOSE":"X","UPDATED":"00000000","COLL":"200040089939-078-9","NAME_":"ARIVAVL.FILIPDEDIOL","CITY1":"Dubrovnik","POST_CODE1":"20000","STREET":"CVIJETEZUZORI\u01061","HOUSE_NUM":null,"MAIL_CITY1":"SomeCity","MAIL_POST":"20000","MAIL_STREET":"SomeStreetName","MAIL_HOUSE":null,"ITEM":[{"SEGMENT":"1","BEL":"019234104313","XB":"2844552100119061","FAED":"20190617","AGD":"20190823","INITAMNT":"61.51","PAYAMNT":"61.51","WRTOFFAMNT":"0.00","OPENAMNT":"0.00","INVAMNT":"61.51","WS":"AUD","REC":"00000000"},{"SEGMENT":"1","OPB":"019234171002","XBL":"2844552100119071","FAE":"20190717","AG":"20190823","INITAMNT":"61.25","PAYAMNT":"61.25","WRTOFFAMNT":"0.00","OPENAMNT":"0.00","INVAMNT":"61.25","WS":"HRK","REC":"00000000"}],"MSISDN":{"MSI":"3858909851217"},"MCD":{"MCD_M":null,"MCD_AT":null},"PHONE":null},{"SEGMENT":"1","
问题是,我只需要在引号之间包含一个数字,所有出现的INITAMNT, PAYAMNT, WRTOFFAMNT, OPENAMNT, INVAMNT
包括以数字显示的相应金额,例如:
[64] => "200004008993","INITAMNT":"61.51","PAYAMNT":"61.51","WRTOFFAMNT":"0.00","OPENAMNT":"0.00","INVAMNT":"61.51","INITAMNT":"61.25","PAYAMNT":"61.25","WRTOFFAMNT":"0.00","OPENAMNT":"0.00","INVAMNT":"61.25"