如何在PHP中顯示來自此JSON的屬性?我正在從包含多個JSON對象的文件中讀取JSON。我想打印並只顯示src_ip
屬性。使用PHP顯示JSON對象屬性
PHP
json_string = file_get_contents("eve.json");
JSON
{
"timestamp": "2016-03-24T20:41:16.751426",
"event_type": "alert",
"src_ip": "192.168.0.102",
"dest_ip": "192.168.0.105",
"proto": "ICMP",
"icmp_type": 8,
"icmp_code": 0,
"alert":
"action": "allowed",
"gid": 1,
"signature_id": 2100480,
"rev": 6,
"signature": "GPL ICMP_INFO PING speedera",
"category": "Misc activity",
"severity": 3
}
}
你如何看待它? –
我想顯示它在PHP文件和WMN塊阻止SRC IP地址,並只顯示阻止的SRC IP地址數據 – ZaonX
$ json_string = file_get_contents(「eve.json」); – ZaonX