dever 3 年 前
コミット
3bd3f747d6
1 ファイル変更9 行追加2 行削除
  1. 9 2
      src/Address.php

+ 9 - 2
src/Address.php

@@ -77,13 +77,20 @@ class Address  extends Base
             } elseif (strstr($data['address'], '市')) {
                 $temp = explode('市', $data['address']);
                 $data['province_name'] = $temp[0] . '市';
+                $city = '';
+                unset($temp[0]);
+                $city = implode('', $temp);
             } elseif (strstr($data['address'], '区')) {
                 $temp = explode('区', $data['address']);
                 $data['province_name'] = $temp[0] . '区';
+
+                $city = '';
+                unset($temp[0]);
+                $city = implode('', $temp);
             }
 
-            if (strstr($temp[1], '市')) {
-                $temp = explode('市', $temp[1]);
+            if (strstr($city, '市')) {
+                $temp = explode('市', $city);
                 $data['city_name'] = $temp[0] . '市';
             }
             $data['county_name'] = $temp[1];