function read_brd_dir() { (中略) } $cdir->close(); // return $brd_menus; この行削除 } return $brd_menus; //この行追加 }