Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
ac8fec54
Commit
ac8fec54
authored
Jun 10, 2003
by
Mac Newbold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a handy function to recursively print the contents of an array.
parent
d639bd53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
www/defs.php3.in
www/defs.php3.in
+16
-0
No files found.
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
Markdown
is supported
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