Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
ac8fec54
Commit
ac8fec54
authored
Jun 10, 2003
by
Mac Newbold
Browse files
Add a handy function to recursively print the contents of an array.
parent
d639bd53
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/defs.php3.in
View file @
ac8fec54
...
...
@@ -313,6 +313,22 @@ function LASTNODELOGIN($node)
{
}
#
# A function to print the contents of an array (recursively).
# Mostly useful for debugging.
#
function
ARRAY_PRINT
(
$arr
)
{
if
(
!
is_array
(
$arr
))
{
echo
"non-array '
$arr
'
\n
"
;
}
foreach
(
$arr
as
$i
=>
$val
)
{
echo
(
"'
$i
' - '
$val
'
\n
"
);
if
(
is_array
(
$val
))
{
echo
"Sub-array
$i
:
\n
"
;
array_print
(
$val
);
echo
"End Sub-array
$i
.
\n
"
;
}
}
}
#
# Beware empty spaces (cookies)!
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment