<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 獲取省市區的json數據里面的具體的數據 > #### 2017-7-6 jig update 對函數進行了更新,兼容可以通過地區名查出地區代碼 ,詳細信息往下看 **位置:** Common\Common\function.php 1、 下面是原方法的調用: **參數:** > * @param int $code 數字代碼 > * @return string **調用:** > $city = get_address('440300'); // 返回深圳市 **View模版中調用:** > {$vo.city|get_address} **完整代碼:** ~~~ /** * 獲取省市區的json數據里面的具體的數據 * * @param int $code 數字代碼 * @return string * */ function get_address($code) { $json = fopen(APP_ROOT . 'Public/plug/address/list.json','r'); $data = stream_get_contents($json); $obj = json_decode($data); $arr = object_to_array($obj); return $arr[$code]; } ~~~ 2、修改后的方法調用,可**兼容老的調用方式** **參數:** * @param int $param 數字代碼或字符串 * @param int $type 類型,默認為空,空是地區代碼查地區名,1是地區名查地區代碼 **調用:** * $city = get_address('440300'); // 返回深圳市 * $code = get_address('深圳市',1); // 返回深圳市的地區代碼, 440300 **View模版中調用:** * {$vo.city|get_address} * {$vo.code,1|get_address} **完整代碼:** ~~~ /** * 獲取省市區的json數據里面的具體的數據 * * @param int $param 數字代碼或字符串 * @param int $type 類型,默認為空,空是地區代碼查地區名,1是地區名查地區代碼 * @return string * jig 2016-12-30 add * jig 2017-7-6 update * */ function get_address($param, $type = '') { $json = fopen(APP_ROOT . 'Public/plug/address/list.json', 'r'); $data = stream_get_contents($json); $obj = json_decode($data); $arr = object_to_array($obj); if ($type === 1) { $arr = array_flip($arr); // 把數組鍵值替換 } return $arr[$param]; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看