We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4e4d00 commit 49c7a2dCopy full SHA for 49c7a2d
1 file changed
src/func.php
@@ -12,6 +12,8 @@
12
13
if (!function_exists('println')) {
14
/**
15
+ * print multi vars with newline.
16
+ *
17
* @param mixed ...$vars
18
*
19
* @return void
@@ -39,6 +41,35 @@ function println(...$vars): void
39
41
}
40
42
43
44
+if (!function_exists('printm')) {
45
+ /**
46
+ * print multi vars.
47
48
+ * @param mixed ...$vars
49
50
+ * @return void
51
+ */
52
+ function printm(...$vars): void
53
+ {
54
+ $eleNum = count($vars);
55
+ if ($eleNum === 1) {
56
+ echo DataHelper::toString($vars[0]);
57
+ return;
58
+ }
59
+
60
+ if ($eleNum === 0) {
61
62
63
64
+ // eleNum > 1
65
+ $ss = [];
66
+ foreach ($vars as $var) {
67
+ $ss[] = DataHelper::toString($var);
68
69
+ echo implode('', $ss);
70
71
+}
72
73
if (!function_exists('vdump')) {
74
75
* Dump data like var_dump
0 commit comments