File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1212
1313if (!function_exists ('println ' )) {
1414 /**
15+ * print multi vars with newline.
16+ *
1517 * @param mixed ...$vars
1618 *
1719 * @return void
@@ -39,6 +41,35 @@ function println(...$vars): void
3941 }
4042}
4143
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+ return ;
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+
4273if (!function_exists ('vdump ' )) {
4374 /**
4475 * Dump data like var_dump
You can’t perform that action at this time.
0 commit comments