陈德本 пре 5 година
родитељ
комит
c2f9ac426d
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      App/Api/Controller/ReceivedSms.php

+ 3 - 2
App/Api/Controller/ReceivedSms.php

@@ -21,9 +21,10 @@ class ReceivedSms extends RestfulController
         $data = file(APP_DIR . "/test_msg.txt");
         $result = [];
         foreach ($data as $datum) {
-            $pat = "#-[操作:(.*)]#";
+            $pat = "#-[操作:(.*)]#iUs";
             preg_match($pat, $datum, $arr);
-            if ($arr[1]) {
+            if ($arr) {
+                print_r($arr);
                 $temp = explode("$$$", $arr[1]);
                 $result[] = [
                     'from' => $temp[1],