Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function TYPE($value = NULL) {
- $value = self::flattenArrayIndexed($value);
- if (is_array($value) && (count($value) > 1)) {
- $a = array_keys($value);
- $a = array_pop($a);
- // Range of cells is an error
- if (self::isCellValue($a)) {
- return 16;
- // Test for Matrix
- } elseif (self::isMatrixValue($a)) {
- return 64;
- }
- } elseif(empty($value)) {
- // Empty Cell
- return 1;
- }
- $value = self::flattenSingleValue($value);
- if (($value === NULL) || (is_float($value)) || (is_int($value))) {
- return 1;
- } elseif(is_bool($value)) {
- return 4;
- } elseif(is_array($value)) {
- return 64;
- break;
- //return false;
- } elseif(is_string($value)) {
- // Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
- return 16;
- }
- return 2;
- }
- return 0;
- } // function TYPE()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement