tp5獲取數據庫全部表

//獲取全部的表
        $sql = "show tables";
            $re = Db::query($sql);
        $d = Config::get('database')['database'];
        $s = 'Tables_in_' . $d;
      //轉換爲索引數組
        $data = [];
        foreach ($re as $index => $item) {
            $r=strpos($item[$s],'fa_basic');
// if($r !== false){
                array_push($data, $item[$s]);
// }
        }
        rsort($data);

複製代碼
相關文章
相關標籤/搜索