1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Mead
- * Date: 2019/9/3
- * Time: 8:05 PM
- */
- namespace App\Servers;
- class MsgForwardServer extends BaseServer
- {
- public function main($body)
- {
- $data = $this->decode($body);
- self::log($data, 'MsgForwardServer', self::$LOG_MAJOR);
- return false;
- }
- /**
- * 解析装载的数据
- * @param $body
- * @return array
- * User: Mead
- */
- private function decode($body)
- {
- $i = 0;
- $box_no = self::stitching($body, $i, 5);
- $i += 5;
- // 短信发送者的号码
- $mobile = self::stitching($body, $i, 10);
- $i += 10;
- // 短信内容
- $body = self::stitching($body, $i, false);
- // 处理值
- $box_no = $this->decodeBoxNo($box_no);
- return [
- 'box_no' => $box_no,
- 'mobile' => $mobile,
- 'body' => $body
- ];
- }
- }
|