ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Arrays.php
Go to the documentation of this file.
1
<?
php
2
namespace
SimpleSAML\Utils
;
3
9
class
Arrays
10
{
11
24
public
static
function
arrayize
(
$data
,
$index
= 0)
25
{
26
return
(is_array(
$data
)) ?
$data
: array(
$index
=>
$data
);
27
}
28
29
39
public
static
function
transpose
($array)
40
{
41
if
(!is_array($array)) {
42
return
false
;
43
}
44
45
$ret
= array();
46
foreach
($array as $k1 => $a2) {
47
if
(!is_array($a2)) {
48
return
false
;
49
}
50
51
foreach
($a2 as $k2 => $v) {
52
if
(!array_key_exists($k2,
$ret
)) {
53
$ret
[$k2] = array();
54
}
55
$ret
[$k2][$k1] = $v;
56
}
57
}
58
return
$ret
;
59
}
60
}
SimpleSAML\Utils\Arrays\transpose
static transpose($array)
This function transposes a two-dimensional array, so that $a['k1']['k2'] becomes $a['k2']['k1'].
Definition:
Arrays.php:39
SimpleSAML\Utils\Arrays\arrayize
static arrayize($data, $index=0)
Put a non-array variable into an array.
Definition:
Arrays.php:24
$index
$index
Definition:
metadata.php:60
SimpleSAML\Utils
Definition:
Arrays.php:2
SimpleSAML\Utils\Arrays
Definition:
Arrays.php:9
$ret
$ret
Definition:
parser.php:6
php
$data
$data
Definition:
bench.php:6
libs
composer
vendor
simplesamlphp
simplesamlphp
lib
SimpleSAML
Utils
Arrays.php
Generated on Thu Jan 16 2025 19:01:55 for ILIAS by
1.8.13 (using
Doxyfile
)