如何解析stdclass

时间:2016-12-22 07:41:16

标签: php mysql sms stdclass

我将此数据作为回复:

Messages

如何打印$counter=count($results->GetReceiveMessagesResult->Messages); 项?

using System.Text.RegularExpressions;

// ...

var vcounter = Regex.Matches(input, "[aeiou]", RegexOptions.IgnoreCase).Count;

2 个答案:

答案 0 :(得分:0)

您可以使用foreach循环

尝试

foreach ($results->GetReceiveMessagesResult->Messages as $msg)
{
    echo $msg->MessageID;
}

答案 1 :(得分:0)

$counter=count($results->GetReceiveMessagesResult->Messages);
if($counter>0)
{
    foreach ($results->GetReceiveMessagesResult->Messages as $msg)
    {
       echo $msg->MessageID;
       echo $msg->RecipientNumber;
    }
}