FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
texttable-php/example-random-table.php at master · dan-da/texttable-php · GitHub
dan-da
/
texttable-php
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
9
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
texttable-php
/
example-random-table.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
30 lines (23 loc) · 713 Bytes
Breadcrumbs
texttable-php
/
example-random-table.php
Copy path
File metadata and controls
executable file
·
30 lines (23 loc) · 713 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env php
<?php
require_once
(
__DIR__
.
'
/texttable.class.php
'
);
$
data
= [];
srand
(
microtime
(
true
));
$
numcols
=
rand
(
2
,
6
);
for
(
$
i
=
0
;
$
i
<
20
;
$
i
++ ) {
$
row
= [];
for
(
$
j
=
0
;
$
j
<
$
numcols
;
$
j
++ ) {
$
buf
=
''
;
if
(
rand
(
0
,
60
) ==
0
) {
$
buf
=
rand
(
0
,
10000
);
}
$
key
=
sprintf
(
'
col-%d
'
,
$
j
+
1
);
$
row
[
$
key
] =
$
buf
.
rand
(
0
,
1000
);
}
$
data
[] =
$
row
;
}
$
headertypes
= [
'
keys
'
,
'
firstrow
'
,
'
none
'
];
$
headertype
=
$
headertypes
[
rand
(
0
,
count
(
$
headertypes
) -
1
)];
$
footertypes
= [
'
keys
'
,
'
lastrow
'
,
'
none
'
];
$
footertype
=
$
footertypes
[
rand
(
0
,
count
(
$
footertypes
) -
1
)];
echo
texttable::
table
(
$
data
,
$
headertype
,
$
footertype
);
Back
|
FazBrowse Home
|
New Git URL