SHARE
TWEET

Untitled

a guest Jun 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top