How to print_r $_POST array?

前端 未结 11 2217
我在风中等你
我在风中等你 2020-12-31 14:39

I have following table.

11条回答
  •  Happy的楠姐
    2020-12-31 15:29

    Because you have nested arrays, then I actually recommend a recursive approach:

    function recurse_into_array( $in, $tabs = "" )
    {
        foreach( $in as $key => $item )
        {
            echo $tabs . $key . ' => ';
            if( is_array( $item ) )
            {
                recurse_into_array( $item, $tabs . "\t" );
            }
            else
            {
                echo $tabs . "\t" . $key;
            }
        }
    }
    
    recurse_into_array( $_POST );
    

提交回复
热议问题