学习ThinkPHP3.2.2:vidio7,一个函数用于输出数组

时间:2022-10-29 10:36:21

D:\wamp\www\wish\Index\Common\Common\function.php,这个文件中的函数会被自动加载。

1
2
3
function  p($array){
     dump($array,  1 '<pre>' 0 );
}


在控制器中增加方法:

1
2
3
4
Public  function  handle(){
     p($_POST);     // 接收并输出post参数
     p(I( 'post.' ));   // 接收并输出post参数
}


输出内容是一样的:

 
1
2
3
4
5
6
7
8
9
10
Array
(
     [username] => aaa
     [content] => bbb
)
  Array
(
     [username] => aaa
     [content] => bbb
)