how I convert the json string to label in php
Example for Data from mysql:
[{"slot":1,"name":"id_card","type":"item","amount":1,"info":{"citizenid":"JDS70650","birthdate":"111111-11-11","nationality":"Saudi","lastname":"60","gender":0,"firstname":"Loading"}},{"slot":2,"name":"driver_license","type":"item","amount":1,"info":{"lastname":"60","firstname":"Loading","birthdate":"111111-11-11","type":"A1-A2-A | AM-B | C1-C-CE"}},{"slot":3,"name":"weapon_pistol_mk2","type":"weapon","amount":1,"info":{"ammo":0,"serie":"83Vin3pE957ZCXh","attachments":[{"component":"COMPONENT_PISTOL_MK2_CLIP_02","label":"Extended"},{"component":"COMPONENT_AT_PI_FLSH_02","label":"Flashlight"}]}},{"slot":4,"name":"electronickit","type":"item","amount":1,"info":[]},{"slot":5,"name":"signalradar","type":"item","amount":1,"info":[]},{"slot":6,"name":"phone","type":"item","amount":1,"info":[]},{"slot":7,"name":"advancedrepairkit","type":"item","amount":1,"info":[]},{"slot":8,"name":"rifle_ammo","type":"item","amount":1,"info":[]},{"slot":9,"name":"weapon_carbinerifle","type":"weapon","amount":1,"info":{"attachments":[{"component":"COMPONENT_AT_AR_FLSH","label":"Flashlight"},{"component":"COMPONENT_AT_SCOPE_MEDIUM","label":"3x Scope"}],"serie":"02MiQ2Gs862DEup"}},{"slot":10,"name":"empy_contract","type":"item","amount":1,"info":""},{"slot":11,"name":"pd_pistol_ammo","type":"item","amount":1,"info":[]},{"slot":12,"name":"pd_rifle_ammo","type":"item","amount":1,"info":[]},{"slot":13,"name":"adrenaline","type":"item","amount":1,"info":[]},{"slot":14,"name":"ifak","type":"item","amount":1,"info":[]},{"slot":15,"name":"pd_smg_ammo","type":"item","amount":1,"info":[]},{"slot":16,"name":"parachute","type":"item","amount":1,"info":[]},{"slot":17,"name":"snowball","type":"item","amount":3,"info":""},{"slot":18,"name":"radio","type":"item","amount":1,"info":[]},{"slot":19,"name":"empty_evidence_bag","type":"item","amount":1,"info":[]},{"slot":20,"name":"taser_ammo","type":"item","amount":1,"info":[]},{"slot":21,"name":"weapon_flashlight","type":"weapon","amount":1,"info":{"serie":"03ZkH3Ny206dsag"}},{"slot":22,"name":"weapon_nightstick","type":"weapon","amount":1,"info":{"serie":"61ari3aG530Euta"}},{"slot":23,"name":"handcuffs","type":"item","amount":1,"info":[]},{"slot":24,"name":"binoculars","type":"item","amount":1,"info":[]},{"slot":25,"name":"diving_gear","type":"item","amount":1,"info":[]},{"slot":26,"name":"weapon_combatpdw","type":"weapon","amount":1,"info":{"attachments":[{"component":"COMPONENT_COMBATPDW_CLIP_02","label":"Extended"},{"component":"COMPONENT_AT_AR_FLSH","label":"Flashlight"},{"component":"COMPONENT_AT_AR_AFGRIP","label":"Grip"},{"component":"COMPONENT_AT_SCOPE_SMALL","label":"Scope"}],"serie":"99aQn7oe001edrg"}},{"slot":27,"name":"weapon_m4","type":"weapon","amount":1,"info":{"attachments":[{"component":"COMPONENT_M4_CLIP_02","label":"Extended"},{"component":"COMPONENT_AT_M4_FLSH","label":"Flashlight"},{"component":"COMPONENT_AT_SCOPE_M4","label":"Scope"},{"component":"COMPONENT_AT_M4_AFGRIP","label":"Grip"}],"serie":"53TQV8Zr243pEzy"}},{"slot":28,"name":"weapon_carbinerifle_mk2","type":"weapon","amount":1,"info":{"attachments":[{"component":"COMPONENT_CARBINERIFLE_CLIP_02","label":"Extended"},{"component":"COMPONENT_AT_AR_FLSH","label":"Flashlight"},{"component":"COMPONENT_AT_AR_AFGRIP","label":"Grip"}],"serie":"25bcq9eS227JQEG"}},{"slot":29,"name":"weapon_taser","type":"weapon","amount":1,"info":{"serie":"04KMX6tB447agpD"}},{"slot":30,"name":"weapon_fireextinguisher","type":"weapon","amount":1,"info":{"serie":"08jTs4oj108aJhr"}},{"slot":31,"name":"trojan_usb","type":"item","amount":1,"info":[]},{"slot":32,"name":"securitycase","type":"item","amount":2,"info":""},{"slot":33,"name":"weed_white-widow_seed","type":"item","amount":4,"info":""},{"slot":34,"name":"fitbit","type":"item","amount":1,"info":""},{"slot":35,"name":"methbrick","type":"item","amount":7,"info":""},{"slot":36,"name":"metalscrap","type":"item","amount":8,"info":""},{"slot":37,"name":"copper","type":"item","amount":7,"info":""},{"slot":38,"name":"frappuccino","type":"item","amount":1,"info":""}]
I want like this:
Name: id_card
Slot: 1
Amount: 1
Info:
citizenid: JDS70650
source https://stackoverflow.com/questions/73708253/how-i-convert-json-array-and-object-to-label-in-php
No comments:
Post a Comment