是否可以格式化var_dump
或print_r
的数据?
我们经常使用var_dump
和print_r
检查数组或对象。
但这是非常复杂的数据。没有水平。真重。
文字:
Array ( [0] => stdClass Object ( [id] => 190 [ipv4s] => Array ( ) [physical_server_buy_record] => stdClass Object ( [is_using] => [desc] => [create_time] => 2018-07-25T04:26:09.942404Z [expire_time] => 2018-07-25T04:26:09.942404Z ) [server_status] => 今天过期 [name] => SE02-B24 [desc] => [cpu] => Intel Xeon E3-1230 v5 [ram] => Supermicro DDR4___16 [disk] => Intel SSD___240 [price] => 1000.00 [pay_time] => 2018-07-25T12:26:09.841842+08:00 [expire_time] => 2018-07-26T12:11:45.841842+08:00 [ipmi_addr] => 172.16.30.216 [ipmi_account_and_pwd] => [customer_desc] => [whmcs_tblhosting_id] => [ctime] => 2018-07-02T05:11:43.176443+08:00 [uptime] => 2018-07-25T12:26:09.995883+08:00 [physical_server_model] => stdClass Object ( [id] => 8 .....
那么,有没有办法格式化这种类型的数据?
例如,如果存在复杂的json数据,我们可以将其粘贴到json.cn,然后对其进行格式化。