0

在确认在我们的手机号码中发布短信警报后,我尝试使用 php 编码来注册我们的产品..在使用 way2 短信移动网站..似乎发生了一些错误....

消息已发送到您的电子邮件地址 正在登录 ... 注意:未定义的偏移量:C:\wamp\www\html\class.sms.php 第 126 行的 1 正在发送 SMS ... 注意:未定义的偏移量:C 中的 1: \wamp\www\html\class.sms.php 在第 147 行遇到错误:

class.sms.php :


preg_match($pattern,$out,$matches);
        $id=trim($matches[1]);     // 126 line
        $this->data['id']=$id;

    }

    private function send_160by2($number,$msg)
    {
        $msg=urlencode($msg);
        $id=$this->data['id'];
        $out1=$this->curl->post("http://m.160by2.com/...Compose.asp?l=1","txt_mobileno=$number&txt_msg=$msg&cmdSend=Send+SMS&TID=&T_MsgId=&Msg=$id");
        //echo $out1;
        $pattern = '/\<table.+?\>(.+)\<\/table/s';
        preg_match($pattern, $out1, $matches);

        $out=strip_tags(@$matches[1]);
        if(count($matches)<1)
        {
        $pattern="/\<div.+?background:.+?yellow.+?\>(.+?)\<\/div\>/s";

        preg_match($pattern,$out1,$matches);

        $out=strip_tags($matches[1]);           // 147 line 
        }
4

1 回答 1

0

该消息对我来说看起来很清楚:$matches[1]在 position 没有元素1。尝试像这样打印你的$matches数组,你会看到你有什么:

preg_match($pattern,$out,$matches);
print_r($matches);

看起来您的 RegEx 没有返回任何结果$matches

于 2013-04-15T13:04:03.333 回答