官方函数页:get_defined_vars()

get_defined_vars — Returns an array of all defined variables,返回所有定义过的变量

范例:

Array
(
    [GLOBALS] => Array
        (
            [GLOBALS] => Array
 *RECURSION*
            [_POST] => Array
                (
                )

            [_GET] => Array
                (
                )

            [_COOKIE] => Array
                (
                )

            [_FILES] => Array
                (
                )

            [modDb] => 2
            [modTable] => 32
            [uid] => 308914351
            [resultDb] => 2
            [resultTable] => 16
            [startDate] => 2011-05-24 20:20:00
            [startId] => 100
            [p0] => 
            [p1] => (
            [p2] => ,'
            [p3] => ','
            [p4] => ',1500,120,2,1,18,'["2","5","10","11","15","16"]',8,'"2,12"',2,145,1450,7250,72500,10,'{"651":10}',10000000,102,3024,5,1,8,200000,200000,827438,'0.150',94,1115107,'0.300',114,1921625,'0.480',155,2170892,'0.630',161,9764126,'"16:6"','null','null',2,4,4,50,5,'[]','[]',0,'"1:4"',3000,300)
            [p6] => ,
            [p7] => ;
            [loop] => 100
            [sql] => 
            [i] => 200
        )

    [_POST] => Array
        (
        )

    [_GET] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [modDb] => 2
    [modTable] => 32
    [uid] => 308914351
    [resultDb] => 2
    [resultTable] => 16
    [startDate] => 2011-05-24 20:20:00
    [startId] => 100
    [p0] => 
    [p1] => (
    [p2] => ,'
    [p3] => ','
    [p4] => ',1500,120,2,1,18,'["2","5","10","11","15","16"]',8,'"2,12"',2,145,1450,7250,72500,10,'{"651":10}',10000000,102,3024,5,1,8,200000,200000,827438,'0.150',94,1115107,'0.300',114,1921625,'0.480',155,2170892,'0.630',161,9764126,'"16:6"','null','null',2,4,4,50,5,'[]','[]',0,'"1:4"',3000,300)
    [p6] => ,
    [p7] => ;
    [loop] => 100
    [sql] => 
    [i] => 200
)