Reputation: 85
I want to check the capabilities of incoming phone numbers.
foreach ($client->account->incoming_phone_numbers as $number) {
echo $number->phone_number;
echo $number->capabilities;
}
but it didn't work.
Upvotes: 1
Views: 134
Reputation: 1244
Ricky from Twilio here.
Since the capabilities are stored in an object you can echo
them. But you can see them using print_r
:
foreach ($client->account->incoming_phone_numbers as $number) {
echo $number->phone_number;
print_r($number->capabilities);
}
If you want to check for a specific capability (for example: mms) you could do something like this:
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";
}
}
Let me know if that helps or if I can help with anything else.
Upvotes: 2