【发布时间】:2016-02-24 21:41:57
【问题描述】:
我知道这个问题已经被问过很多次了,所以模组请不要关闭它,因为过去的答案都没有用,而且我已经搜索过了!所以我正在使用 HaveIBeenPwned API,它输出显然是 JSON 的内容,如下所示:
[
{
"Title":"000webhost"
,"Name":"000webhost"
,"Domain":"000webhost.com"
,"BreachDate":"2015-03-01"
,"AddedDate":"2015-10-26T23:35:45Z"
,"PwnCount":12345678
,"Description":"In approximately March 2015, the free web hosting provider 000webhost suffered a major data breach that exposed over 13 million customer records. The data was sold and traded before 000webhost was alerted in October. The breach included names, email addresses and plain text passwords."
,"DataClasses":[
"Email addresses"
,"IP addresses"
,"Names"
,"Passwords"
]
,"IsVerified":true
,"IsSensitive":false
,"LogoType":"png"
}
]
如果我使用以下内容,这就是输出:
echo $output;
json_decode($output) 不起作用。使用 foreach($output as $key) 不起作用,如果我使用它,它会说无效参数。我尝试了一个正常的for() 循环,但又没有任何乐趣。这个输出有什么问题?我如何获得其中的价值?你应该可以看出我正在使用 PHP。
【问题讨论】: