pretty dump
echo '<pre>' . var_export($data, true) . '</pre>';
pretty dump
echo '<pre>' . var_export($data, true) . '</pre>';
python print pretty json
import json
json_data = '[{"ID":10,"Name":"Pankaj","Role":"CEO"},' \
'{"ID":20,"Name":"David Lee","Role":"Editor"}]'
json_object = json.loads(json_data)
json_formatted_str = json.dumps(json_object, indent=2)
print(json_formatted_str)
python write to json with indent
import json
# alphabetic dictionary
json_data = {hex(k): chr(k) for k in range(ord('a'), ord('z') + 1)}
# to file
with open("my_json.json", "w") as file:
json.dump(json_data, file, indent=4, sort_keys=True)
pretty dump
highlight_string("<?php\n\$data =\n" . var_export($data, true) . ";\n?>");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us