标签:dump get 页面 ble variable art begin ring 调试
<?php session_start(); //把接收到的变量打印到html的注释里。 这样查看页面源代码的时候可用检查接收到的变量,而不会影响页面的结构 echo "\n<!--BEGIN VARIABLE DUMP-->\n\n"; echo "\n<!--BEGIN GET VARS-->\n\n"; echo "\n<!--".dump_array($_GET)."-->\n\n"; echo "\n<!--BEGIN POST VARS-->\n\n"; echo "\n<!--".dump_array($_POST)."-->\n\n"; echo "\n<!--BEGIN SESSION VARS-->\n\n"; echo "\n<!--".dump_array($_SESSION)."-->\n\n"; echo "\n<!--BEGIN COOKIE VARS-->\n\n"; echo "\n<!--".dump_array($_COOKIE)."-->\n\n"; echo "\n<!--BEGIN VARIABLE DUMP-->\n\n"; function dump_array($array){ if(is_array($array)){ $size = count($array); $string = ""; $if($size){ $count = 0; $string .= "{"; foreach($array as $var => $value){ if($count++ < ($size-1)){ $string .= ", "; } } $string .=" }"; } return $string; }else{ //if it is not an array,just retun it; return $array; } } ?>
标签:dump get 页面 ble variable art begin ring 调试
原文地址:https://www.cnblogs.com/connectionworld/p/13187534.html