Skip to content
Browse files

initial code commit

  • Loading branch information...
1 parent 3a4fb45 commit 3ed68912a8091de7c0e759d1a225d895f4f4cc13 @giveit-deploy giveit-deploy committed Nov 14, 2012
Showing with 38 additions and 2 deletions.
  1. +34 −0 ArrayTools.php
  2. +4 −2 README.md
View
34 ArrayTools.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ *
+ * @author David Kelly
+ *
+ */
+
+namespace opensourceame;
+
+class ArrayTools
+{
+ const version = '1.0.1';
+
+ /**
+ * Convert an object into a multidimensional array
+ *
+ * @param object $object
+ * @return array
+ */
+ static public function objectToArray( $object )
+ {
+ if ( (! is_object($object)) and (! is_array( $object )))
+ {
+ return $object;
+ }
+
+ if (is_object($object))
+ {
+ $object = get_object_vars($object);
+ }
+
+ return array_map('\opensourceame\arrayUtils::objectToArray', $object);
+ }
+}
View
6 README.md 100644 → 100755
@@ -1,4 +1,6 @@
-Array
+ArrayTools
=====
-Array tools
+Array tools
+
+see: http://opensourceame.com

0 comments on commit 3ed6891

Please sign in to comment.
Something went wrong with that request. Please try again.