Skip to content

Commit 7a80042

Browse files
authored
Update helpers.php
1 parent 0c438cc commit 7a80042

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/helpers.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,42 @@ function curl(string $url, string $method = "GET", array $params = [], array $he
108108
];
109109
}
110110
}
111+
112+
if (!function_exists('p')) {
113+
/**
114+
* 调试方法
115+
* @param array $data [description]
116+
*/
117+
function p($data, $die = 1)
118+
{
119+
echo "<pre>";
120+
print_r($data);
121+
echo "</pre>";
122+
if ($die) die;
123+
}
124+
}
125+
126+
if (!function_exists('mdump')) {
127+
/**
128+
* 调试方法
129+
* @param array $data [description]
130+
*/
131+
function mdump()
132+
{
133+
foreach (func_get_args() as $item) {
134+
p($item, 0);
135+
}
136+
}
137+
}
138+
139+
if (!function_exists('mdd')) {
140+
/**
141+
* 调试方法
142+
* @param array $data [description]
143+
*/
144+
function mdd()
145+
{
146+
mdump(...func_get_args());
147+
die;
148+
}
149+
}

0 commit comments

Comments
 (0)