Skip to content
Snippets Groups Projects
Commit 42b21405 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Allow arrayize to set the index of the new array

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1196 44740490-163a-0410-bde0-09ae8108e29a
parent 23682d08
No related branches found
No related tags found
No related merge requests found
...@@ -1661,11 +1661,11 @@ class SimpleSAML_Utilities { ...@@ -1661,11 +1661,11 @@ class SimpleSAML_Utilities {
/* /*
* Input is single value or array, returns an array. * Input is single value or array, returns an array.
*/ */
public static function arrayize($data) { public static function arrayize($data, $index = 0) {
if (is_array($data)) { if (is_array($data)) {
return $data; return $data;
} else { } else {
return array($data); return array($index => $data);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment