我想查看来电号码的功能。
foreach ($client->account->incoming_phone_numbers as $number) {
echo $number->phone_number;
echo $number->capabilities;
}
但它没有用。
答案 0 :(得分:2)
来自Twilio的Ricky。
由于功能存储在对象中,您可以echo
。但您可以使用print_r
:
foreach ($client->account->incoming_phone_numbers as $number) {
echo $number->phone_number;
print_r($number->capabilities);
}
如果您想检查特定功能(例如:mms),您可以执行以下操作:
foreach ($client->account->incoming_phone_numbers as $number) {
echo $number->phone_number;
if($number->capabilities->mms) {
echo " has mms capability.";
} else {
echo " does not have mms capability";
}
}
如果有帮助或者我可以提供其他任何帮助,请告诉我。