如何获取给定正值或以下 1 的数组的索引是我的数组。
Array( [0] => stdClass Object
( [result] => )
[1] => stdClass Object
( [result] => 1 )
[2] => stdClass Object
( [result] => )
[3] => stdClass Object
( [result] => )
[4] => stdClass Object
( [result] => )
[5] => stdClass Object
( [result] => )
[6] => stdClass Object
( [result] => 1 )
)
上面的数组结果来自这个函数,它的作用是验证提交给 PQ 的电子邮件地址,如果电子邮件有效并已注册,它将返回 1 或 true,现在我需要隔离这个有效且已注册的电子邮件,因为我需要向其余电子邮件发送邀请。
function get_email_verification(){
$api_request_url = "http://api.payquicker.com/api/IsActiveAccount";
foreach ($this->get_payquicker_emails() as $email) {
$param = "email=".$email;
$result_request[] = $this->do_request($api_request_url, $param, 'GET', 'json');
}
if (empty($result_request)) {
echo "All payee emails are already registered to Payquicker";
}
return $result_request;
}