在PHP中,如果声明了全局的变量$db,则在函数体外引用了声明单元后可以直接使用,而在函数体中则要声明一下global $db后才可以使用。

posted on 2009-06-10 16:45  garfieldtom  阅读(169)  评论(0编辑  收藏  举报