Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public static function TYPE($value = NULL) {
  2. $value = self::flattenArrayIndexed($value);
  3. if (is_array($value) && (count($value) > 1)) {
  4. $a = array_keys($value);
  5. $a = array_pop($a);
  6. // Range of cells is an error
  7. if (self::isCellValue($a)) {
  8. return 16;
  9. // Test for Matrix
  10. } elseif (self::isMatrixValue($a)) {
  11. return 64;
  12. }
  13. } elseif(empty($value)) {
  14. // Empty Cell
  15. return 1;
  16. }
  17. $value = self::flattenSingleValue($value);
  18.  
  19. if (($value === NULL) || (is_float($value)) || (is_int($value))) {
  20. return 1;
  21. } elseif(is_bool($value)) {
  22. return 4;
  23. } elseif(is_array($value)) {
  24. return 64;
  25. break;
  26. //return false;
  27. } elseif(is_string($value)) {
  28. // Errors
  29. if ((strlen($value) > 0) && ($value{0} == '#')) {
  30. return 16;
  31. }
  32. return 2;
  33. }
  34. return 0;
  35. } // function TYPE()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement